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

This commit is contained in:
Christophe Battarel
2012-09-25 07:56:50 +02:00
390 changed files with 29870 additions and 3604 deletions

View File

@@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.3 compared to 3.2.2 *****
For users:
- New: [ task #289 ] Can reorder tasks.
- New: Add field "signature" into thirdparty card. If filled, text is added
at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this
feature is disabled.
@@ -28,6 +29,9 @@ For users:
- New: Add link to third party into sells and purchase journal.
- New: Suggest a method to generate a backup file for user with no access
to mysqldump binary.
- New: Can use extrafields on contacts/addresses.
- New: Support unique field for extrafields.
- New: Extra fields supports more types (now int, string, double, date, datetime).
- New: Can correct stock of a warehouse from warehouse card.
- New: [ task #185 ]: Can input amount when correcting stock to recalculate PMP.
- New: [ task #454 ]: Add "No category" into filters on category.
@@ -35,16 +39,16 @@ For users:
- New: More surface control on stock correction page.
- New: Add great britain provinces.
- New: Update libs/tools/logo for DoliWamp.
- New: [ task #494 ] Send an email to foundation when a new member has auto-subscribed
- New: [ task #326 ]: Add a numbering module to suggest automatically a product ref
- New: Add conditional substitution IF/ELSEIF/ENDIF for ODT templates
- New: [ task #494 ] Send an email to foundation when a new member has auto-subscribed.
- New: [ task #326 ]: Add a numbering module to suggest automatically a product ref.
- New: Add conditional substitution IF/ELSEIF/ENDIF for ODT templates.
- New: Add unit foot2, inch2, foot3 and inch3 for surface and volumes.
- New: Can select thirdparties into emailing targets, even if module category is not enabled.
- New: [ task #498 ] Improvement of the block to add products/services lines.
- New: ECM autodir works also for files joined to products and services.
- New: Add a selection module for emailing to enter a recipient from gui.
- New: Allow to search product from barcodes directly from the permanent mini search left box
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX
- New: Allow to search thirds and products from barcodes directly from the permanent mini search left box.
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX.
New experimental modules:
- New: Add margin and commissions management module.
- New: Add holiday module.
@@ -53,6 +57,7 @@ New experimental modules:
- Fix: No images into product description lines as PDF generation does
not work with this.
- Fix: Errors weren't being shown in customer's & supplier's orders
- Fix: Lastname wasn't being recorded in xinputuser emailing module
For developers:
- New: Add webservice for thirdparty creation and list.

View File

@@ -111,7 +111,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
$head = member_admin_prepare_head($adh);
$head = member_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
@@ -136,10 +136,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('constvalue',!$conf->global->ADHERENT_LOGIN_NOT_REQUIRED,1);
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?$conf->global->ADHERENT_LOGIN_NOT_REQUIRED:1),1);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print "</td></tr>\n";
@@ -151,10 +150,9 @@ $var=!$var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
print $form->selectyesno('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED,1);
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print "</td></tr>\n";
@@ -165,10 +163,9 @@ $var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="ADHERENT_DEFAULT_SENDINFOBYMAIL">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
print $form->selectyesno('constvalue',$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL,1);
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
print '</td><td align="center" width="80">';
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
print "</td></tr>\n";
@@ -179,10 +176,9 @@ $var=!$var;
print '<form action="adherent.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print '<td>';
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 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
@@ -34,15 +35,12 @@ $extrafields = new ExtraFields($db);
$form = new Form($db);
// List of supported format
$type2label=array(
'varchar'=>$langs->trans('String'),
'text'=>$langs->trans('Text'),
'int'=>$langs->trans('Int'),
'date'=>$langs->trans('Date'),
'datetime'=>$langs->trans('DateAndTime')
);
$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
$type2label=array('');
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
$action=GETPOST("action");
$action=GETPOST('action', 'alpha');
$attrname=GETPOST('attrname', 'alpha');
$elementtype='member';
if (!$user->admin) accessforbidden();
@@ -70,7 +68,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
$head = member_admin_prepare_head($adh);
$head = member_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user');
@@ -90,6 +88,7 @@ print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("AttributeCode").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Unique").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
@@ -102,6 +101,7 @@ foreach($extrafields->attribute_type as $key => $value)
print "<td>".$key."</td>\n";
print "<td>".$type2label[$extrafields->attribute_type[$key]]."</td>\n";
print '<td align="right">'.$extrafields->attribute_size[$key]."</td>\n";
print '<td align="right">'.yn($extrafields->attribute_unique[$key])."</td>\n";
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&attrname='.$key.'">'.img_edit().'</a>';
print "&nbsp; <a href=\"".$_SERVER["PHP_SELF"]."?action=delete&attrname=".$key."\">".img_delete()."</a></td>\n";
print "</tr>";
@@ -112,10 +112,8 @@ print "</table>";
dol_fiche_end();
/*
* Barre d'actions
*
*/
// Buttons
if ($action != 'create' && $action != 'edit')
{
print '<div class="tabsAction">';
@@ -135,29 +133,7 @@ if ($action == 'create')
print "<br>";
print_titre($langs->trans('NewAttribute'));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table summary="listofattributes" class="border" width="100%">';
print '<input type="hidden" name="action" value="add">';
// Label
print '<tr><td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.GETPOST('label').'"></td></tr>';
// Code
print '<tr><td class="fieldrequired" required>'.$langs->trans("AttributeCode").' ('.$langs->trans("AlphaNumOnlyCharsAndNoSpace").')</td><td class="valeur"><input type="text" name="attrname" size="10" value="'.GETPOST('attrname').'"></td></tr>';
// Type
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td><td class="valeur">';
print $form->selectarray('type',$type2label,GETPOST('type'));
print '</td></tr>';
// Size
print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td><input type="text" name="size" size="5" value="'.(GETPOST('size')?GETPOST('size'):'255').'"></td></tr>';
print '</table>';
print '<center><br><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
print "</form>\n";
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
}
/* ************************************************************************** */
@@ -165,47 +141,12 @@ if ($action == 'create')
/* Edition d'un champ optionnel */
/* */
/* ************************************************************************** */
if ($_GET["attrname"] && $action == 'edit')
if ($action == 'edit' && ! empty($attrname))
{
print "<br>";
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
/*
* formulaire d'edition
*/
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$_GET["attrname"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
print '<input type="hidden" name="action" value="update">';
print '<table summary="listofattributes" class="border" width="100%">';
// Label
print '<tr>';
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$_GET["attrname"]].'"></td>';
print '</tr>';
// Code
print '<tr>';
print '<td class="fieldrequired" required>'.$langs->trans("AttributeCode").'</td>';
print '<td class="valeur">'.$_GET["attrname"].'&nbsp;</td>';
print '</tr>';
// Type
$type=$extrafields->attribute_type[$_GET["attrname"]];
$size=$extrafields->attribute_size[$_GET["attrname"]];
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td>';
print '<td class="valeur">';
print $type2label[$type];
print '<input type="hidden" name="type" value="'.$type.'">';
print '</td></tr>';
// Size
print '<tr><td class="fieldrequired" required>'.$langs->trans("Size").'</td><td class="valeur"><input type="text" name="size" size="5" value="'.$size.'"></td></tr>';
print '</table>';
print '<center><br><input type="submit" name="button" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';
print "</form>";
print_titre($langs->trans("FieldEdition", $attrname));
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
}
$db->close();

View File

@@ -151,7 +151,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup');
$head = mailmanspip_admin_prepare_head($adh);
$head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
@@ -163,7 +163,7 @@ dol_htmloutput_mesg($mesg);
* Mailman
*/
$var=!$var;
if ($conf->global->ADHERENT_USE_MAILMAN)
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
@@ -214,7 +214,7 @@ else
dol_fiche_end();
if ($conf->global->ADHERENT_USE_MAILMAN)
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{
print '<form action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="testsubscribe">';

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("members");
$langs->load("admin");
$action=GETPOST('action');
$action=GETPOST('action', 'alpha');
if (! $user->admin) accessforbidden();
@@ -43,10 +44,15 @@ if (! $user->admin) accessforbidden();
if ($action == 'update')
{
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$_POST["MEMBER_ENABLE_PUBLIC"],'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$_POST["MEMBER_NEWFORM_AMOUNT"],'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$_POST["MEMBER_NEWFORM_EDITAMOUNT"],'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$_POST["MEMBER_NEWFORM_PAYONLINE"],'chaine',0,'',$conf->entity);
$public=GETPOST('MEMBER_ENABLE_PUBLIC');
$amount=GETPOST('MEMBER_NEWFORM_AMOUNT');
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -74,7 +80,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
$head = member_admin_prepare_head($adh);
$head = member_admin_prepare_head();
dol_fiche_head($head, 'public', $langs->trans("Member"), 0, 'user');
@@ -123,7 +129,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
print "</td></tr>\n";
// Type
@@ -141,7 +147,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("DefaultAmount");
print '</td><td width="60" align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.$conf->global->MEMBER_NEWFORM_AMOUNT.'">';;
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';;
print "</td></tr>\n";
// Can edit
@@ -150,10 +156,10 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("CanEditAmount");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",$conf->global->MEMBER_NEWFORM_EDITAMOUNT,1);
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
print "</td></tr>\n";
if ($conf->paybox->enabled || $conf->paypal->enabled)
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
{
// Jump to an online payment page
$var=! $var;
@@ -161,9 +167,9 @@ if ($conf->paybox->enabled || $conf->paypal->enabled)
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td width="60" align="right">';
$listofval=array();
if ($conf->paybox->enabled) $listofval['paybox']='Paybox';
if ($conf->paypal->enabled) $listofval['paypal']='PayPal';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,$conf->global->MEMBER_NEWFORM_PAYONLINE,1);
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
print "</td></tr>\n";
}

View File

@@ -112,7 +112,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup');
$head = mailmanspip_admin_prepare_head($adh);
$head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
@@ -123,7 +123,7 @@ dol_htmloutput_mesg($mesg);
* Spip
*/
$var=!$var;
if ($conf->global->ADHERENT_USE_SPIP)
if (! empty($conf->global->ADHERENT_USE_SPIP))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">';

View File

@@ -79,7 +79,7 @@ if ($id)
llxHeader("",$langs->trans("Agenda"),'');
if ($conf->notification->enabled) $langs->load("mails");
if (! empty($conf->notification->enabled)) $langs->load("mails");
$head = member_prepare_head($object);
dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user');
@@ -142,7 +142,7 @@ if ($id)
print '<div class="tabsAction">';
if ($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>';
}

View File

@@ -246,7 +246,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
}
else
{
if ($conf->banque->enabled && $_POST["paymentsave"] != 'none')
if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none')
{
if ($_POST["cotisation"])
{
@@ -479,7 +479,7 @@ if ($rowid)
$rowspan=9;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1;
if ($conf->societe->enabled) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -545,7 +545,7 @@ if ($rowid)
print '</td></tr>';
// Third party Dolibarr
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
@@ -675,7 +675,7 @@ if ($rowid)
print '<td align="center">'.$langs->trans("DateSubscription").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print '<td align="right">'.$langs->trans("Account").'</td>';
}
@@ -693,7 +693,7 @@ if ($rowid)
print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
print '<td align="right">'.price($objp->cotisation).'</td>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print '<td align="right">';
if ($objp->bid)
@@ -720,7 +720,7 @@ if ($rowid)
// Link for paypal payment
if ($conf->paypal->enabled)
if (! empty($conf->paypal->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('membersubscription',$object->ref);
@@ -740,8 +740,8 @@ if ($rowid)
$bankdirect=0; // Option to write to bank is on by default
$bankviainvoice=0; // Option to write via invoice is on by default
$invoiceonly=0;
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1;
if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled && $object->fk_soc) $bankviainvoice=1;
if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1;
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
print "\n\n<!-- Form add subscription -->\n";
@@ -873,7 +873,7 @@ if ($rowid)
print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
// Complementary action
if ($conf->banque->enabled || $conf->facture->enabled)
if (! empty($conf->banque->enabled) || ! empty($conf->facture->enabled))
{
$company=new Societe($db);
if ($object->fk_soc)
@@ -889,12 +889,12 @@ if ($rowid)
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(!$bankdirect&&!$bankviainvoice?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':'');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
}
if ($conf->societe->enabled && $conf->facture->enabled)
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.($invoiceonly?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
@@ -909,7 +909,7 @@ if ($rowid)
}
print '<br>';
}
if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled)
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';

View File

@@ -160,7 +160,7 @@ class Adherent extends CommonObject
// Envoi mail confirmation
$from=$conf->email_from;
if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM;
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
@@ -1382,7 +1382,7 @@ class Adherent extends CommonObject
}
// spip
if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled)
if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
{
$result=$mailmanspip->add_to_spip($this);
if ($result < 0)
@@ -1427,7 +1427,7 @@ class Adherent extends CommonObject
}
}
if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled)
if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
{
$result=$mailmanspip->del_to_spip($this);
if ($result < 0)
@@ -1787,31 +1787,31 @@ class Adherent extends CommonObject
$this->fullname=$this->getFullName($langs);
// Member
if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
if ($this->pass && $conf->global->LDAP_MEMBER_FIELD_PASSWORD) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
if ($this->poste && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
if ($this->adresse && $conf->global->LDAP_MEMBER_FIELD_ADDRESS) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse;
if ($this->cp && $conf->global->LDAP_MEMBER_FIELD_ZIP) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
if ($this->ville && $conf->global->LDAP_MEMBER_FIELD_TOWN) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
if ($this->country_code && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
if ($this->email && $conf->global->LDAP_MEMBER_FIELD_MAIL) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
if ($this->phone && $conf->global->LDAP_MEMBER_FIELD_PHONE) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
if ($this->phone_perso && $conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
if ($this->phone_mobile && $conf->global->LDAP_MEMBER_FIELD_MOBILE) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && $conf->global->LDAP_MEMBER_FIELD_FAX) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
if ($this->note && $conf->global->LDAP_MEMBER_FIELD_DESCRIPTION) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
if ($this->naiss && $conf->global->LDAP_MEMBER_FIELD_BIRTHDATE) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse;
if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
// Subscriptions
if ($this->first_subscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
if (isset($this->first_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
if ($this->last_subscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap');
if (isset($this->last_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount;
if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap');
if (isset($this->last_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount;
return $info;
}

View File

@@ -99,7 +99,7 @@ if ($result)
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder);
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder);
}
@@ -131,7 +131,7 @@ if ($result)
$var=!$var;
if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation)
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "<form method=\"post\" action=\"cotisations.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -153,7 +153,7 @@ if ($result)
print '</td>';
// Banque
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
if ($objp->fk_account)
{
@@ -193,7 +193,7 @@ if ($result)
print '<td align="right">'.price($objp->cotisation).'</td>';
print "</tr>";
if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation)
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "</form>\n";
}
@@ -207,7 +207,7 @@ if ($result)
print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">&nbsp;</td>\n";
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
print '<td>&nbsp;</td>';
}

View File

@@ -54,7 +54,7 @@ $socid=GETPOST('socid','int');
// Security check
$result=restrictedArea($user,'adherent',$rowid);
if ($conf->mailmanspip->enabled)
if (! empty($conf->mailmanspip->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@@ -212,7 +212,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes')
if ($object->email)
{
$from=$conf->email_from;
if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM;
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
@@ -844,7 +844,7 @@ if ($action == 'create')
/*
// Third party Dolibarr
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">';
print $form->select_company($object->fk_soc,'socid','',1);
@@ -924,7 +924,7 @@ if ($action == 'edit')
$rowspan=15;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if ($conf->societe->enabled) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++;
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
@@ -1064,7 +1064,7 @@ if ($action == 'edit')
}
// Third party Dolibarr
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2" class="valeur">';
if ($object->fk_soc)
@@ -1148,7 +1148,7 @@ if ($rowid && $action != 'edit')
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)
);
$text=$langs->trans("ConfirmCreateLogin").'<br>';
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser");
else $text.=$langs->trans("UserWillBeInternalUser");
@@ -1204,8 +1204,8 @@ if ($rowid && $action != 'edit')
// Cree un tableau formulaire
$formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
if ($conf->global->ADHERENT_USE_MAILMAN) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); }
if ($conf->global->ADHERENT_USE_SPIP) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); }
if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); }
if (! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); }
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
}
@@ -1276,7 +1276,7 @@ if ($rowid && $action != 'edit')
$rowspan=17;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if ($conf->societe->enabled) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++;
print '<table class="border" width="100%">';
@@ -1382,7 +1382,7 @@ if ($rowid && $action != 'edit')
}
// Third party Dolibarr
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
@@ -1532,7 +1532,7 @@ if ($rowid && $action != 'edit')
}
// Create third party
if ($conf->societe->enabled && ! $object->fk_soc)
if (! empty($conf->societe->enabled) && ! $object->fk_soc)
{
if ($user->rights->societe->creer)
{
@@ -1570,7 +1570,7 @@ if ($rowid && $action != 'edit')
}
// Action SPIP
if ($conf->mailmanspip->enabled && $conf->global->ADHERENT_USE_SPIP)
if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP))
{
$isinspip = $mailmanspip->is_in_spip($object);

View File

@@ -66,7 +66,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
// If transaction consolidated
if ($accountline->rappro)
{
$errmsg=$langs->trans("SubscriptionLinkedToConciliatedTrnasaction");
$errmsg=$langs->trans("SubscriptionLinkedToConciliatedTransaction");
}
else
{
@@ -220,7 +220,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
print '<input type="text" class="flat" size="60" name="note" value="'.$subscription->note.'"></td></tr>';
// Bank line
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank)
{
@@ -290,7 +290,7 @@ if ($rowid && $action != 'edit')
//$formquestion=array();
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text=$langs->trans("ConfirmDeleteSubscription");
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1);
if ($ret == 'html') print '<br>';
}
@@ -335,7 +335,7 @@ if ($rowid && $action != 'edit')
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$subscription->note.'</td></tr>';
// Bank line
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank)
{

View File

@@ -203,7 +203,7 @@ $var=true;
*/
$max=5;
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
$sql.= " a.tms as datem, datefin as date_end_subscription,";
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
@@ -232,11 +232,18 @@ if ($resql)
$staticmember->id=$obj->rowid;
$staticmember->lastname=$obj->lastname;
$staticmember->firstname=$obj->firstname;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
}
$staticmember->ref=$staticmember->getFullName($langs);
$statictype->id=$obj->typeid;
$statictype->libelle=$obj->libelle;
print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
print '<td>'.$statictype->getNomUrl(1,16).'</td>';
print '<td>'.$staticmember->getNomUrl(1,32).'</td>';
print '<td>'.$statictype->getNomUrl(1,32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '</tr>';
@@ -256,7 +263,7 @@ else
*/
$max=5;
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,";
$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
$sql.= " datefin as date_end_subscription,";
$sql.= " c.rowid as cid, c.tms as datem, c.datec as datec, c.dateadh as date_start, c.datef as date_end, c.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."cotisation as c";
@@ -287,9 +294,16 @@ if ($resql)
$staticmember->id=$obj->rowid;
$staticmember->lastname=$obj->lastname;
$staticmember->firstname=$obj->firstname;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
}
$staticmember->ref=$staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>';
print '<td>'.$staticmember->getNomUrl(1,32,'subscription').'</td>';
print '<td>'.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).'</td>';
print '<td align="right">'.price($obj->cotisation).'</td>';
//print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
@@ -320,7 +334,7 @@ foreach ($AdherentType as $key => $adhtype)
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="type.php?rowid='.$adhtype->id.'">'.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).'</a></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($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$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>';

View File

@@ -120,7 +120,7 @@ print '</tr>';
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
// Password not crypted
if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD)
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD))
{
print '<tr><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td>';
print '<td class="valeur">'.$adh->pass.'</td>';
@@ -128,7 +128,7 @@ if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD)
}
// Password crypted
if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED))
{
print '<tr><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td>';
print '<td class="valeur">'.$adh->pass_crypted.'</td>';

View File

@@ -84,7 +84,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adh&eacute
$now=dol_now();
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe, ";
$sql = "SELECT d.rowid, d.login, d.nom as lastname, d.prenom as firstname, d.societe as company, d.fk_soc,";
$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
@@ -198,7 +198,7 @@ if ($resql)
// Filter on categories
$moreforfilter='';
if ($conf->categorie->enabled)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1);
@@ -238,7 +238,7 @@ if ($resql)
print '<td class="liste_titre">';
$listetype=$membertypestatic->liste_array();
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 12);
print $form->selectarray("type", $listetype, $type, 1, 0, 0, '', 0, 32);
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
@@ -268,6 +268,14 @@ if ($resql)
$memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$companyname=$memberstatic->thirdparty->name;
} else {
$companyname=$objp->company;
}
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -277,14 +285,11 @@ if ($resql)
print "</td>\n";
// Lastname
if ($objp->societe != '')
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";
}
else
{
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".dol_trunc($memberstatic->getFullName($langs))."</a></td>\n";
}
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">";
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
print "</a></td>\n";
// Login
print "<td>".$objp->login."</td>\n";
@@ -293,7 +298,7 @@ if ($resql)
$membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type;
print '<td nowrap="nowrap">';
print $membertypestatic->getNomUrl(1,12);
print $membertypestatic->getNomUrl(1,32);
print '</td>';
// Moral/Physique

View File

@@ -290,7 +290,7 @@ if (! isset($_SERVER['WINDIR']))
}
// Module produits
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
$var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
@@ -308,7 +308,7 @@ if ($conf->societe->enabled)
}
// Module produits
if ($conf->product->enabled)
if (! empty($conf->product->enabled))
{
$var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";

View File

@@ -661,7 +661,7 @@ else
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
else print '&nbsp;';
print '</td></tr>';

View File

@@ -113,7 +113,7 @@ print "</tr>\n";
print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT
if ($conf->global->MAIN_MODULE_COMPTABILITE)
if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
{
// print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));

View File

@@ -84,14 +84,14 @@ $head[$h][1] = $langs->trans("Setup");
$hselected=$h;
$h++;
if ($conf->global->MAIN_SUBMODULE_EXPEDITION)
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$h++;
}
if ($conf->global->MAIN_SUBMODULE_LIVRAISON)
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Receivings");

View File

@@ -8,6 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* 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
@@ -136,7 +137,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
$tabsql[9] = "SELECT code_iso as code, label as libelle, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
@@ -158,7 +159,7 @@ $tabsqlsort[2] ="pays ASC, code ASC";
$tabsqlsort[3] ="pays ASC, code ASC";
$tabsqlsort[4] ="code ASC";
$tabsqlsort[5] ="libelle ASC";
$tabsqlsort[6] ="a.type ASC, a.module, a.position, a.code ASC";
$tabsqlsort[6] ="a.type ASC, a.module ASC, a.position ASC, a.code ASC";
$tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC";
$tabsqlsort[8] ="libelle ASC";
$tabsqlsort[9] ="libelle ASC";
@@ -188,7 +189,7 @@ $tabfield[6] = "code,libelle,type,position";
$tabfield[7] = "code,libelle,pays_id,pays,deductible";
$tabfield[8] = "code,libelle";
$tabfield[9] = "code,libelle,unicode";
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1,localtax2,localtax1_type,localtax2,localtax2_type,accountancy_code,note";
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfield[13]= "code,libelle,type";
@@ -214,7 +215,7 @@ $tabfieldvalue[6] = "code,libelle,type,position";
$tabfieldvalue[7] = "code,libelle,pays,deductible";
$tabfieldvalue[8] = "code,libelle";
$tabfieldvalue[9] = "code,libelle,unicode";
$tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1,localtax2,localtax1_type,localtax2,localtax2_type,accountancy_code,note";
$tabfieldvalue[10]= "pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[11]= "element,source,code,libelle";
$tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldvalue[13]= "code,libelle,type";
@@ -240,7 +241,7 @@ $tabfieldinsert[6] = "code,libelle,type,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,deductible";
$tabfieldinsert[8] = "code,libelle";
$tabfieldinsert[9] = "code_iso,label,unicode";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1,localtax2,localtax1_type,localtax2,localtax2_type,accountancy_code,note";
$tabfieldinsert[10]= "fk_pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[11]= "element,source,code,libelle";
$tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfieldinsert[13]= "code,libelle,type";
@@ -374,13 +375,14 @@ $localtax_typeList = array();
if (GETPOST("id") == 10)
{
$localtax_typeList = array(
"1" => $langs->trans("%ageOnAllWithoutVAT"),
"2" => $langs->trans("%ageOnAllBeforeVAT"),
"3" => $langs->trans("%ageOnProductsWithoutVAT"),
"4" => $langs->trans("%ageOnProductsBeforeVAT"),
"5" => $langs->trans("%ageOnServiceWithoutVAT"),
"6" => $langs->trans("%ageOnServiceBeforeVAT"),
"7" => $langs->trans("AmountOnOrder")
"0" => $langs->trans("No"),
"1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
"2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)", //$langs->trans("%ageOnServiceBeforeVAT"),
"7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
);
}
$msg='';
@@ -398,14 +400,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1;
foreach ($listfield as $f => $value)
{
if ($value == 'pays')
{
if (in_array('region_id',$listfield)) { continue; } // For region page, we do not require the country input
}
if ($value == 'pays' && in_array('region_id',$listfield)) continue; // For region page, we do not require the country input
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& $listfield[$f] != 'decalage' // Fields that are not mandatory
&& $listfield[$f] != 'module' // Fields that are not mandatory
&& $listfield[$f] != 'accountancy_code') // Fields that are not mandatory
// && (! in_array($listfield[$f], array('decalage','module','accountancy_code','localtax1','localtax2'))) // Fields that are not mandatory
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code_sell','accountancy_code_buy'))) // Fields that are not mandatory
)
{
$ok=0;
$fieldnamekey=$listfield[$f];
@@ -425,10 +426,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'<br>';
}
}
// Autres verif
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && $_POST["type"]=='system') {
// Other checks
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
$ok=0;
$msg.="Value 'system' for type is reserved. You can use 'user' as value to add your own record.<br>";
$msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.<br>";
}
if (isset($_POST["code"]) && $_POST["code"]=='0') {
$ok=0;
@@ -438,6 +439,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=0;
$msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>';
}
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
// Si verif ok et action add, on ajoute la ligne
if ($ok && GETPOST('actionadd'))
@@ -658,19 +662,20 @@ if ($id)
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];
if (GETPOST('sortfield'))
if ($sortfield)
{
// If sort order is "pays", we use pays_code instead
if ($_GET["sortfield"] == 'pays') $_GET["sortfield"]='pays_code';
$sql.= " ORDER BY ".$_GET["sortfield"];
if ($_GET["sortorder"])
if ($sortfield == 'pays') $sortfield='pays_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($_GET["sortorder"]);
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Remove from default sort order the choosed order
$tabsqlsort[$id]=preg_replace('/'.$_GET["sortfield"].' '.$_GET["sortorder"].',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/'.$_GET["sortfield"].',/i','',$tabsqlsort[$id]);
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
@@ -681,7 +686,7 @@ if ($id)
$fieldlist=explode(',',$tabfield[$id]);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<form action="dict.php?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" width="100%">';
@@ -705,10 +710,10 @@ if ($id)
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("localtax1"); $align="right";}
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("localtax2"); $align="right";}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("localtax_type"); $align="center";}
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("localtax_type"); $align="center";}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2";}
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3";}
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
@@ -719,7 +724,7 @@ if ($id)
if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
$valuetoshow=$langs->trans("Country");
}
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
@@ -727,7 +732,8 @@ if ($id)
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_number') { $valuetoshow=$langs->trans("Account"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
@@ -779,6 +785,7 @@ if ($id)
print '<tr><td colspan="'.(count($fieldlist)+2).'">&nbsp;</td></tr>';
}
print '</form>';
// List of available values in database
dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
@@ -805,24 +812,33 @@ if ($id)
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$showfield=1; // Par defaut
$align="left";
$sortable=1;
$valuetoshow='';
/*
$tmparray=getLabelOfField($fieldlist[$field]);
$showfield=$tmp['showfield'];
$valuetoshow=$tmp['valuetoshow'];
$align=$tmp['align'];
$sortable=$tmp['sortable'];
*/
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
$valuetoshow=$langs->trans($valuetoshow); // try to translate
$align="left";
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("localtax1"); $align="right";}
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("localtax2"); $align="right";}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("localtax_type"); $align="center";}
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("localtax_type"); $align="center";}
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 2",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $sortable=0; }
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$form->textwithtooltip($langs->trans("UseLocalTax")." 3",$langs->trans("LocalTaxDesc"),2,1,img_help(1,'')); $align="center"; $sortable=0; }
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $sortable=0; }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; $align="center"; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
@@ -830,8 +846,9 @@ if ($id)
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_number') { $valuetoshow=$langs->trans("Accounts"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
@@ -839,26 +856,25 @@ if ($id)
// Affiche nom du champ
if ($showfield)
{
print_liste_field_titre($valuetoshow,$_SERVER["PHP_SELF"],$fieldlist[$field],($page?'page='.$page.'&':'').'&id='.$id,"","align=".$align,$sortfield,$sortorder);
print getTitleFieldOfList($valuetoshow,0,$_SERVER["PHP_SELF"],($sortable?$fieldlist[$field]:''),($page?'page='.$page.'&':'').'&id='.$id,"","align=".$align,$sortfield,$sortorder);
}
}
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"active",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder);
print getTitleFieldOfList($langs->trans("Status"),0,$_SERVER["PHP_SELF"],"active",($page?'page='.$page.'&':'').'&id='.$id,"",'align="center"',$sortfield,$sortorder);
print '<td colspan="2" class="liste_titre">&nbsp;</td>';
print '</tr>';
// Lines with values
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
//print_r($obj);
print "<tr ".$bc[$var].">";
$var = ! $var;
$obj = $db->fetch_object($resql);
//print_r($obj);
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
{
print '<form action="dict.php" method="post">';
print '<form action="dict.php?id='.$id.'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
@@ -873,9 +889,9 @@ if ($id)
print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
}
else
{
$tmpaction = 'view';
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
{
$tmpaction = 'view';
$parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
$reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors;
@@ -889,11 +905,11 @@ if ($id)
$valuetoshow=$obj->$fieldlist[$field];
if ($value == 'element')
{
$valuetoshow = $elementList[$valuetoshow];
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
}
else if ($value == 'source')
{
$valuetoshow = $sourceList[$valuetoshow];
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
}
else if ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
@@ -911,6 +927,7 @@ if ($id)
}
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
$valuetoshow=yn($valuetoshow);
$align="center";
}
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
$valuetoshow=price($valuetoshow);
@@ -1007,12 +1024,14 @@ if ($id)
$valuetoshow=$localtax_typeList[$valuetoshow];
else
$valuetoshow = '';
$align="center";
}
else if ($fieldlist[$field]=='localtax2_type') {
if ($obj->localtax2 != 0)
$valuetoshow=$localtax_typeList[$valuetoshow];
else
$valuetoshow = '';
$align="center";
}
else if ($fieldlist[$field]=='localtax1') {
if ($obj->localtax1 == 0)
@@ -1024,7 +1043,16 @@ if ($id)
$valuetoshow = '';
$align="right";
}
else if (in_array($fieldlist[$field],array('taux','localtax1','localtax2')))
{
$align="right";
}
else if (in_array($fieldlist[$field],array('recuperableonly')))
{
$align="center";
}
// Show value for field
if ($showfield) print '<td align="'.$align.'">'.$valuetoshow.'</td>';
}
}
@@ -1035,7 +1063,7 @@ if ($id)
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0;
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
if (isset($obj->type) && $obj->type == 'system') $iserasable=0;
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else print $langs->trans("AlwaysActive");
@@ -1203,11 +1231,10 @@ function fieldList($fieldlist,$obj='',$tabname='')
}
elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
$align="left";
// Les taxes locales sont cadrées à droite
if ($fieldlist[$field] == 'localtax1' || $fieldlist[$field] == 'localtax2')
$align="right";
if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="right"; // Fields aligned on right
print '<td align="'.$align.'">';
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'"></td>';
print '<input type="text" class="flat" value="'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" size="3" name="'.$fieldlist[$field].'">';
print '</td>';
}
elseif ($fieldlist[$field] == 'libelle_facture') {
print '<td><textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'</textarea></td>';
@@ -1231,14 +1258,18 @@ function fieldList($fieldlist,$obj='',$tabname='')
// Le type de taxe locale
elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type')
{
print '<td>';
print $html->selectarray($fieldlist[$field], $localtax_typeList,$obj->$fieldlist[$field]);
print '<td align="center">';
print $form->selectarray($fieldlist[$field], $localtax_typeList,$obj->$fieldlist[$field]);
print '</td>';
}
else
{
print '<td>';
print '<input type="text" '.($fieldlist[$field]=='libelle'?'size="32" ':'').' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
$size='';
if ($fieldlist[$field]=='libelle') $size='size="32" ';
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
print '</td>';
}
}

View File

@@ -206,7 +206,7 @@ $head[$h][1] = $langs->trans("Sending");
$hselected=$h;
$h++;
if ($conf->global->MAIN_SUBMODULE_LIVRAISON)
if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Receivings");

View File

@@ -628,7 +628,7 @@ $var=!$var;
print '<tr '.$bc[$var].'>';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>";
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";

View File

@@ -69,7 +69,7 @@ foreach($modules as $const => $desc)
{
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM))
{
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
}

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-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
@@ -57,7 +57,6 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
@@ -74,7 +73,10 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
// This one is not always defined
if (isset($_POST["MAIN_USE_PREVIEW_TABS"])) dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["MAIN_USE_PREVIEW_TABS"],'chaine',0,'',$conf->entity);
if (isset($_POST["MAIN_BUGTRACK_ENABLELINK"])) dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
@@ -187,7 +189,7 @@ if ($action == 'edit') // Edit
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
print $form->selectyesno('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
@@ -234,10 +236,21 @@ if ($action == 'edit') // Edit
print '<td width="20">&nbsp;</td>';
print '</tr>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || ! empty($conf->global->MAIN_BUGTRACK_ENABLELINK))
{
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
}
// Message on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
@@ -246,22 +259,12 @@ if ($action == 'edit') // Edit
// Message of the day on home page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, 90);
$doleditor->Create();
print '</td></tr>'."\n";
/*
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print $form->selectyesno('main_show_bugtrack_link',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
print '</table>'."\n";
@@ -387,6 +390,16 @@ else // Show
print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
print '</td></tr>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 || ! empty($conf->global->MAIN_BUGTRACK_ENABLELINK))
{
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
print '<td width="20">&nbsp;</td>';
print "</tr>";
}
// Message login
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
@@ -401,15 +414,6 @@ else // Show
else print '&nbsp;';
print '</td></tr>'."\n";
/*
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
print '<td width="20">&nbsp;</td>';
print "</tr>";
*/
print '</table>'."\n";
print '<div class="tabsAction">';

View File

@@ -124,7 +124,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN)
print '</td></tr>';
// Synchro contact active
if ($conf->societe->enabled)
if (! empty($conf->societe->enabled))
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
@@ -136,7 +136,7 @@ if ($conf->societe->enabled)
}
// Synchro adherentt active
if ($conf->adherent->enabled)
if (! empty($conf->adherent->enabled))
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>';
@@ -189,7 +189,7 @@ print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
// Port
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPServerPort").'</td><td>';
if ($conf->global->LDAP_SERVER_PORT)
if (! empty($conf->global->LDAP_SERVER_PORT))
{
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
}
@@ -227,7 +227,7 @@ print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
// Pass
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPPassword").'</td><td>';
if ($conf->global->LDAP_ADMIN_PASS)
if (! empty($conf->global->LDAP_ADMIN_PASS))
{
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';// je le met en visible pour test
}
@@ -252,7 +252,7 @@ print '</div>';
*/
if (function_exists("ldap_connect"))
{
if ($conf->global->LDAP_SERVER_HOST)
if (! empty($conf->global->LDAP_SERVER_HOST))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestConnect").'</a><br><br>';
}
@@ -269,7 +269,7 @@ if (function_exists("ldap_connect"))
print '<font class="ok">'.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).'</font>';
print '<br>';
if ($conf->global->LDAP_ADMIN_DN && $conf->global->LDAP_ADMIN_PASS)
if ($conf->global->LDAP_ADMIN_DN && ! empty($conf->global->LDAP_ADMIN_PASS))
{
if ($result == 2)
{

View File

@@ -373,7 +373,7 @@ print info_admin($langs->trans("LDAPDescValues"));
/*
* Test de la connexion
*/
if ($conf->global->LDAP_MEMBER_ACTIVE)
if (! empty($conf->global->LDAP_MEMBER_ACTIVE))
{
$butlabel=$langs->trans("LDAPTestSynchroMember");
$testlabel='testmember';

View File

@@ -189,7 +189,7 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
if ($conf->global->MAIN_SUBMODULE_EXPEDITION)
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");

View File

@@ -627,7 +627,7 @@ else
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>';
if ($conf->fckeditor->enabled)
if (! empty($conf->fckeditor->enabled))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&amp;mode=init">'.$langs->trans("DoTestSendHTML").'</a>';
}

View File

@@ -37,6 +37,8 @@ $action=GETPOST('action');
if (!$user->admin) accessforbidden();
$specialtostring=array(0=>'common', 1=>'interfaces', 2=>'other', 3=>'functional', 4=>'marketplace');
/*
* Actions
@@ -150,17 +152,22 @@ foreach ($modulesdir as $dir)
// We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) $modulequalified=0;
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) $modulequalified=0;
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
//if ($mode == 'expdev' && ($objMod->version != 'experimental' && $objMod->version != 'development')) $modulequalified=0;
// Define array $categ with categ with at least one qualified module
if ($modulequalified)
{
$modules[$i] = $objMod;
$filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
//print "x".$modName." ".$orders[$i]."\n<br>";
if (isset($categ[$objMod->special])) $categ[$objMod->special]++; // Array of all different modules categories
else $categ[$objMod->special]=1;
$orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number
$special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown';
if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev';
//print "x".$modName." ".$orders[$i]." ".$special."\n<br>";
if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories
else $categ[$special]=1;
$dirmod[$i] = $dir;
$j++;
$i++;
@@ -188,12 +195,13 @@ asort($orders);
//var_dump($modules);
// Start to show page
if ($mode==0) { $tagmode = 'common'; print $langs->trans("ModulesDesc")."<br>\n"; }
if ($mode==2) { $tagmode = 'other'; print $langs->trans("ModulesSpecialDesc")."<br>\n"; }
if ($mode==1) { $tagmode = 'interfaces'; print $langs->trans("ModulesInterfaceDesc")."<br>\n"; }
if ($mode==3) { $tagmode = 'functional'; print $langs->trans("ModulesJobDesc")."<br>\n"; }
if ($mode==4) { $tagmode = 'marketplace'; print $langs->trans("ModulesMarketPlaceDesc")."<br>\n"; }
if (empty($mode)) $mode='common';
if ($mode==='common') print $langs->trans("ModulesDesc")."<br>\n";
if ($mode==='other') print $langs->trans("ModulesSpecialDesc")."<br>\n";
if ($mode==='interfaces') print $langs->trans("ModulesInterfaceDesc")."<br>\n";
if ($mode==='functional') print $langs->trans("ModulesJobDesc")."<br>\n";
if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."<br>\n";
if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."<br>\n";
$nbofactivatedmodules=count($conf->modules);
print $langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1));
@@ -204,7 +212,7 @@ print "<br>\n";
$h = 0;
$categidx=0; // Main
$categidx='common'; // Main
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
@@ -213,7 +221,7 @@ if (! empty($categ[$categidx]))
$h++;
}
$categidx=2; // Other
$categidx='other'; // Other
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
@@ -222,7 +230,7 @@ if (! empty($categ[$categidx]))
$h++;
}
$categidx=1; // Interfaces
$categidx='interfaces'; // Interfaces
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
@@ -231,7 +239,7 @@ if (! empty($categ[$categidx]))
$h++;
}
$categidx=3; // Not used
$categidx='functional'; // Not used
if (! empty($categ[$categidx]))
{
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
@@ -240,23 +248,31 @@ if (! empty($categ[$categidx]))
$h++;
}
$categidx=4;
//if (! empty($categ[$categidx]))
//{
$categidx='expdev';
if (! empty($categ[$categidx]))
{
$form = new Form($db);
$categidx='expdev';
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
$head[$h][2] = 'marketplace';
$head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);
$head[$h][2] = 'expdev';
$h++;
//}
}
$categidx='marketplace';
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $langs->trans("ModulesMarketPlaces");
$head[$h][2] = 'marketplace';
$h++;
dol_fiche_head($head, $tagmode, $langs->trans("Modules"));
dol_fiche_head($head, $mode, $langs->trans("Modules"));
dol_htmloutput_errors($mesg);
if ($mode != 4)
if ($mode != 'marketplace')
{
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
//print "<tr class=\"liste_titre\">\n";
@@ -271,7 +287,7 @@ if ($mode != 4)
print "</tr>\n";
// Affichage liste modules
// Show list of modules
$var=true;
$oldfamily='';
@@ -295,9 +311,11 @@ if ($mode != 4)
$modName = $filename[$key];
$objMod = $modules[$key];
//var_dump($objMod);
if ($objMod->special != $mode) continue; // Discard if not for tab
//print $objMod->name." - ".$key." - ".$objMod->special.' - '.$objMod->version."<br>";
if (($mode != (isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown') && $mode != 'expdev')
|| ($mode == 'expdev' && $objMod->version != 'development' && $objMod->version != 'experimental')) continue; // Discard if not for current tab
if (! $objMod->getName())
{
dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING);
@@ -327,8 +345,6 @@ if ($mode != 4)
//print "<tr><td>yy".$oldfamily."-".$family."-".$atleastoneforfamily."<br></td><tr>";
}
if ($objMod->special == $mode)
{
$atleastoneforfamily++;
if ($family!=$oldfamily)
@@ -453,7 +469,6 @@ if ($mode != 4)
}
print "</tr>\n";
}
}
print "</table>\n";

View File

@@ -160,7 +160,7 @@ print '<br>';
* Notifications
*/
if ($conf->global->MAIN_MODULE_NOTIFICATION)
if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
{
$langs->load("mails");
print_titre($langs->trans("Notifications"));

View File

@@ -301,7 +301,7 @@ $var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>';
print '<td align="center" width="60">';
if ($conf->global->DATABASE_PWD_ENCRYPTED)
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{
print img_picto($langs->trans("Active"),'tick');
}
@@ -312,7 +312,7 @@ if (! $conf->global->DATABASE_PWD_ENCRYPTED)
print '<a href="security.php?action=activate_encrypt">'.$langs->trans("Activate").'</a>';
print "</td>";
}
if($conf->global->DATABASE_PWD_ENCRYPTED)
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{
print '<td align="center" width="100">';
if ($allow_disable_encryption)

View File

@@ -133,7 +133,7 @@ print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
$var=true;
if ($conf->facture->enabled)
if (! empty($conf->facture->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -147,7 +147,7 @@ if ($conf->facture->enabled)
print "</form>\n</td>\n</tr>\n";
}
if ($conf->commande->enabled)
if (! empty($conf->commande->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -161,7 +161,7 @@ if ($conf->commande->enabled)
print "</form>\n</td>\n</tr>\n";
}
if ($conf->expedition->enabled)
if (! empty($conf->expedition->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -183,7 +183,7 @@ print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n";
$var=true;
if ($conf->fournisseur->enabled)
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -197,7 +197,7 @@ if ($conf->fournisseur->enabled)
print "</form>\n</td>\n</tr>\n";
}
if ($conf->fournisseur->enabled)
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";
@@ -210,7 +210,7 @@ if ($conf->fournisseur->enabled)
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n</td>\n</tr>\n";
}
if ($conf->fournisseur->enabled)
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
print "<tr ".$bc[$var].">";

View File

@@ -39,7 +39,7 @@ $form=new Form($db);
llxHeader();
print_fiche_titre($langs->trans("DatabaseConfiguration"),'','setup');
print_fiche_titre($langs->trans("InfoDatabase"),'','setup');
// Database
print '<table class="noborder" width="100%">';

View File

@@ -42,7 +42,7 @@ $form=new Form($db);
llxHeader();
print_fiche_titre("Dolibarr",'','setup');
print_fiche_titre($langs->trans("InfoDolibarr"),'','setup');
// Version
$var=true;
@@ -178,10 +178,12 @@ print '<tr '.$bc[$var].'><td width="300">&nbsp; => dol_get_first_day(1970,1,fals
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">&nbsp; => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970,1,true).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')</td>';
// Parent company
/*
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("CompanyTZ").'</td><td>'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">&nbsp; => '.$langs->trans("CompanyHour").'</td><td>'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'."\n";
*/
// Client
$var=!$var;
$tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
@@ -210,6 +212,163 @@ print '<tr '.$bc[$var].'><td width="300">&nbsp; => '.$langs->trans("File encodin
print '</table>';
print '<br>';
// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
$configfileparameters=array(
'dolibarr_main_url_root' => $langs->trans("URLRoot"),
'dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
'dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
'separator' => '',
'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
'dolibarr_main_db_type' => $langs->trans("DriverType"),
'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
'?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
'separator' => '',
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
'separator'=> '',
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
'?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
'?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
'?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
'?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
'?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
'?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
'separator' => '',
'?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
'?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
'?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
'?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
'?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
'?dolibarr_js_JQUERY_FLOT' => 'dolibarr_js_JQUERY_FLOT',
'?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
'separator' => '',
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
'?dolibarr_strict_mode' => 'Strict mode is on/off'
);
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Parameters").' ';
print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
print '</td>';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '</tr>'."\n";
foreach($configfileparameters as $key => $value)
{
$ignore=0;
if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) $ignore=1;
if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) $ignore=1;
if (empty($ignore))
{
$newkey = preg_replace('/^\?/','',$key);
if (preg_match('/^\?/',$key) && empty(${$newkey})) continue; // We discard parametes starting with ?
if ($newkey == 'separator' && $lastkeyshown == 'separator') continue;
$var=!$var;
print "<tr ".$bc[$var].">";
if ($newkey == 'separator')
{
print '<td colspan="3">&nbsp;</td>';
}
else
{
// Label
print "<td>".$value.'</td>';
// Key
print '<td>'.$newkey.'</td>';
// Value
print "<td>";
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
else if ($newkey == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
else print ${$newkey};
if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently used by autodetect: '.DOL_MAIN_URL_ROOT.')';
print "</td>";
}
print "</tr>\n";
$lastkeyshown=$newkey;
}
}
print '</table>';
print '<br>';
// Parameters in database
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td align="center">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
print "</tr>\n";
$sql = "SELECT";
$sql.= " rowid";
$sql.= ", ".$db->decrypt('name')." as name";
$sql.= ", ".$db->decrypt('value')." as value";
$sql.= ", type";
$sql.= ", note";
$sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
if (empty($conf->multicompany->enabled))
{
// If no multicompany mode, admins can see global and their constantes
$sql.= " WHERE entity IN (0,".$conf->entity.")";
}
else
{
// If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
if ($user->entity) $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
}
$sql.= " ORDER BY entity, name ASC";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=True;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$obj->name.'</td>'."\n";
print '<td>'.$obj->value.'</td>'."\n";
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td align="center">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
print "</tr>\n";
$i++;
}
}
print '</table>';
llxFooter();
$db->close();

View File

@@ -35,7 +35,7 @@ if (!$user->admin)
llxHeader();
print_fiche_titre("OS",'','setup');
print_fiche_titre($langs->trans("InfoOS"),'','setup');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -23,13 +23,13 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
if (! $user->admin)
accessforbidden();
$what=GETPOST('what','alpha');
/*
@@ -38,85 +38,63 @@ $what=GETPOST('what','alpha');
llxHeader();
/* Style phpinfo
body {background-color: #ffffff; color: #000000;}
body, td, th, h1, h2 {font-family: sans-serif;}
pre {margin: 0px; font-family: monospace;}
$title='InfoPHP';
a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
a:hover {text-decoration: underline;}
table {border-collapse: collapse;}
.center {text-align: center;}
.center table { margin-left: auto; margin-right: auto; text-align: left;}
.center th { text-align: center !important; }
if (isset($title))
{
print_fiche_titre($langs->trans($title), '', 'setup');
}
td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
h1 {font-size: 150%;}
h2 {font-size: 125%;}
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;}
.v {background-color: #cccccc; color: #000000;}
.vr {background-color: #cccccc; text-align: right; color: #000000;}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
*/
ob_start();
if ($what == 'conf')
// Get php_info array
$phparray=phpinfo_array();
foreach($phparray as $key => $value)
{
$title = 'Setup';
phpinfo(INFO_CONFIGURATION);
}
elseif ($what == 'env')
{
$title = 'OSEnv';
phpinfo(INFO_ENVIRONMENT);
}
elseif ($what == 'modules')
{
$title = 'Modules';
phpinfo(INFO_MODULES);
}
else
{
phpinfo();
}
//print_titre($key);
print '<table class="noborder">';
print '<tr class="liste_titre">';
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
print '<td width="220px">'.$key.'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$chaine = ob_get_contents();
ob_end_clean();
// Nettoie la sortie php pour inclusion dans une page deja existante
$chaine = preg_replace('/^<!DOCTYPE(.*)<div class="center">/ims', '', $chaine);
$chaine = preg_replace('/<\/div><\/body><\/html>$/im', '', $chaine);
$chaine = preg_replace('/table(.*)important; \}/i','',$chaine);
$chaine = str_replace('<hr />', '', $chaine);
$chaine = str_replace('cellpadding="3" ', 'cellpadding="1" cellspacing="1" ', $chaine);
$chaine = str_replace('class="h"','class="liste_titre"', $chaine);
$chaine = str_replace('<th colspan="2">', '<td>', $chaine);
$chaine = str_replace('th>', 'td>', $chaine);
// Titles
$chaine = preg_replace('/<h1([^>]*)>/i','<div class="titre">',$chaine);
$chaine = str_replace('<h2>', '<div class="titre">', $chaine);
$chaine = str_replace('</h1>', '</div><br>', $chaine);
$chaine = str_replace('</h2>', '</div>', $chaine);
$chaine = str_replace('<td class="e">', '<td class="impair">', $chaine);
$chaine = str_replace('<td class="v">', '<td class="pair">', $chaine);
$chaine = str_replace('<div class="titre">Configuration</div><br>', '', $chaine);
// Add LF
$chaine = preg_replace('/(pcntl_[a-z]+),/','$1, ',$chaine);
if (isset($title))
{
print_fiche_titre($langs->trans($title), '', 'setup');
print '<br>';
$var=true;
//var_dump($value);
foreach($value as $keyparam => $keyvalue)
{
if (! is_array($keyvalue))
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$keyparam.'</td>';
$valtoshow=$keyvalue;
if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80);
print '<td colspan="2">'.$valtoshow.'</td>';
print '</tr>';
}
else
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$keyparam.'</td>';
$i=0;
foreach($keyvalue as $keyparam2 => $keyvalue2)
{
print '<td>';
$valtoshow=$keyvalue2;
if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow)));
//print $keyparam2.' = ';
print $valtoshow;
$i++;
print '</td>';
}
print '</tr>';
}
}
print '</table><br>';
}
print "$chaine\n"; // Ne pas centrer la reponse php car certains tableau du bas tres large rendent ceux du haut completement a droite
print "<br>\n";
llxFooter();
$db->close();
?>

View File

@@ -42,7 +42,7 @@ if (!$user->admin) accessforbidden();
llxHeader();
print_fiche_titre($langs->trans("WebServer"),'','setup');
print_fiche_titre($langs->trans("InfoWebServer"),'','setup');
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td>".$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";

View File

@@ -36,7 +36,7 @@ $choice=GETPOST('choice');
// Define filelog to discard it from purge
$filelog='';
if ($conf->syslog->enabled)
if (! empty($conf->syslog->enabled))
{
$filelog=SYSLOG_FILE;
$filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog);
@@ -131,7 +131,7 @@ print '<table class="border" width="100%">';
print '<tr class="border"><td style="padding: 4px">';
if ($conf->syslog->enabled)
if (! empty($conf->syslog->enabled))
{
print '<input type="radio" name="choice" value="logfile"';
print ($choice && $choice=='logfile') ? ' checked="checked"' : '';

View File

@@ -66,7 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Security check
if (! $conf->clicktodial->enabled)
if (empty($conf->clicktodial->enabled))
{
accessforbidden();
exit;

View File

@@ -105,7 +105,7 @@ print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyFo
print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
print '</td></tr>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
@@ -126,7 +126,7 @@ if ($conf->banque->enabled)
print '</td></tr>';
}
if ($conf->stock->enabled)
if (! empty($conf->stock->enabled))
{
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>';
@@ -135,7 +135,7 @@ if ($conf->stock->enabled)
print '</td></tr>';
}
if ($conf->service->enabled)
if (! empty($conf->service->enabled))
{
$var=! $var;
print '<tr '.$bc[$var].'><td>';

View File

@@ -144,7 +144,7 @@ class Facturation
$newcartarray[$i]['price']=$product->price;
$newcartarray[$i]['price_ttc']=$product->price_ttc;
if ($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
if (isset($product->multiprices[$societe->price_level]))
{

View File

@@ -30,14 +30,14 @@ if ( $_GET['filtre'] ) {
$ret=array(); $i=0;
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
$sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' ";
if ($conf->barcode->enabled) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')";
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')";
else $sql.= ")";
$sql.= " ORDER BY label";
@@ -67,9 +67,9 @@ if ( $_GET['filtre'] ) {
$i=0;
$sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";

View File

@@ -44,9 +44,9 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client);
if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least
{
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1";
$sql.= " AND p.fk_product_type = 0";

View File

@@ -32,9 +32,9 @@ switch ( $_GET['action'] )
if ( $_POST['hdnSource'] != 'NULL' )
{
$sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
@@ -62,7 +62,7 @@ switch ( $_GET['action'] )
}
/** add Ditto for MultiPrix*/
if ($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
$productid = $ret['rowid'];

View File

@@ -98,7 +98,7 @@ print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf-
print '</td>';
print "</tr>\n";
if ($conf->stock->enabled)
if (! empty($conf->stock->enabled))
{
$langs->load("stocks");
print "<tr>";

View File

@@ -49,14 +49,14 @@ if (! ($thirdpartyid > 0))
}
// If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished.
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
{
$retour=$langs->trans("CashDeskSetupStock");
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;
}
if (! empty($_POST['txtUsername']) && $conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
{
$langs->load("errors");
$retour=$langs->trans("ErrorModuleSetupNotComplete");

View File

@@ -74,7 +74,7 @@ $langs->load("cashdesk");
$label = $tab_designations[$i]['label'];
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],7).' - '.dol_trunc($label,35,'middle');
if ($conf->stock->enabled && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.$tab_designations[$i]['reel'].')';
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.$tab_designations[$i]['reel'].')';
print '</option>'."\n ";
}
@@ -92,7 +92,7 @@ $langs->load("cashdesk");
$label = $tab_designations[$i]['label'];
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],7).' - '.dol_trunc($label,35,'middle');
if ($conf->stock->enabled && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
print '</option>'."\n ";
}

View File

@@ -48,7 +48,7 @@ if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE))
$bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE);
$bankchequeLink = $bankcheque->getNomUrl(1);
}
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled)
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled))
{
$warehouse=new Entrepot($db);
$warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]);
@@ -72,7 +72,7 @@ print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled)
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled))
{
print $langs->trans("CashDeskWarehouse").': '.$warehouseLink;
}

View File

@@ -161,7 +161,7 @@ switch ($action)
$product->fetch($tab_liste[$i]['fk_article']);
$ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price);
if ($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
if (isset($product->multiprices[$societe->price_level]))
{

View File

@@ -182,7 +182,7 @@ if ($socid)
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$langs->load("companies");
if ($conf->notification->enabled) $langs->load("mails");
if (! empty($conf->notification->enabled)) $langs->load("mails");
$soc = new Societe($db);
$result = $soc->fetch($socid);
@@ -363,7 +363,7 @@ else if ($id || $ref)
$rowspan=5;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1;
if ($conf->societe->enabled) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++;
print '<table class="border" width="100%">';

View File

@@ -147,7 +147,7 @@ class Categorie
dol_syslog(get_class($this).'::create sql='.$sql);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,";
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{
$sql.= "fk_soc,";
}
@@ -157,7 +157,7 @@ class Categorie
//$sql.= ", fk_parent_id";
$sql.= ")";
$sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',";
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{
$sql.= ($this->socid != -1 ? $this->socid : 'null').",";
}
@@ -269,7 +269,7 @@ class Categorie
{
$sql .= ", description = '".$this->db->escape($this->description)."'";
}
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
}

View File

@@ -129,7 +129,7 @@ if ($object->id)
print '</td></tr>';
// Visibility
/* if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
/* if ($type == 0 && ! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{
if ($object->socid)
{

View File

@@ -96,13 +96,14 @@ class CActionComm
}
/**
* Return list of event types
* Return list of event types
*
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @return array Array of all event types if OK, <0 if KO
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude
* @return array Array of all event types if OK, <0 if KO
*/
function liste_array($active='',$idorcode='id')
function liste_array($active='',$idorcode='id',$excludetype='')
{
global $langs,$conf;
$langs->load("commercial");
@@ -112,10 +113,8 @@ class CActionComm
$sql = "SELECT id, code, libelle, module";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '')
{
$sql.=" WHERE active=".$active;
}
if ($active != '') $sql.=" WHERE active=".$active;
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";
$sql.= " ORDER BY module, position";
dol_syslog(get_class($this)."::liste_array sql=".$sql);

View File

@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("companies");
$langs->load("commercial");
@@ -222,7 +222,7 @@ if ($objectid > 0)
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)

View File

@@ -450,7 +450,7 @@ if ($action == 'create')
}
else
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode");
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>';
@@ -760,7 +760,7 @@ if ($id)
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
// Projet associe
$langs->load("project");
@@ -927,7 +927,7 @@ if ($id)
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)

View File

@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;

View File

@@ -212,7 +212,7 @@ if ($action == 'create')
print "</td></tr>";
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
$projectid = 0;
if ($origin == 'project') $projectid = ($originid?$originid:0);
@@ -294,7 +294,7 @@ if ($action == 'create')
}
print '</td></tr>';
if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print '<tr><td colspan="3">&nbsp;</td></tr>';
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '<tr><td colspan="3">&nbsp;</td></tr>';
print '<tr><td valign="top"><input type="radio" name="createmode" value="empty" checked="checked"></td>';
print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
@@ -303,7 +303,7 @@ if ($action == 'create')
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
{
print '<tr><td colspan="3">';
if ($conf->product->enabled || $conf->service->enabled)
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$lib=$langs->trans("ProductsAndServices");

View File

@@ -31,20 +31,20 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if ($conf->ficheinter->enabled) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$langs->load("companies");
if ($conf->contrat->enabled) $langs->load("contracts");
if ($conf->commande->enabled) $langs->load("orders");
if ($conf->facture->enabled) $langs->load("bills");
if ($conf->projet->enabled) $langs->load("projects");
if ($conf->ficheinter->enabled) $langs->load("interventions");
if ($conf->notification->enabled) $langs->load("mails");
if (! empty($conf->contrat->enabled)) $langs->load("contracts");
if (! empty($conf->commande->enabled)) $langs->load("orders");
if (! empty($conf->facture->enabled)) $langs->load("bills");
if (! empty($conf->projet->enabled)) $langs->load("projects");
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
if (! empty($conf->notification->enabled)) $langs->load("mails");
// Security check
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
@@ -345,7 +345,7 @@ if ($id > 0)
print '</tr>';
// Multiprice level
if ($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
@@ -364,7 +364,7 @@ if ($id > 0)
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent
if ($conf->adherent->enabled)
if (! empty($conf->adherent->enabled))
{
$langs->load("members");
$langs->load("users");
@@ -410,7 +410,7 @@ if ($id > 0)
/*
* Last proposals
*/
if ($conf->propal->enabled && $user->rights->propal->lire)
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$propal_static = new Propal($db);
@@ -472,7 +472,7 @@ if ($id > 0)
/*
* Last orders
*/
if ($conf->commande->enabled && $user->rights->commande->lire)
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$commande_static=new Commande($db);
@@ -527,7 +527,7 @@ if ($id > 0)
/*
* Last linked contracts
*/
if ($conf->contrat->enabled && $user->rights->contrat->lire)
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{
$contratstatic=new Contrat($db);
@@ -587,7 +587,7 @@ if ($id > 0)
/*
* Last interventions
*/
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
{
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
@@ -642,7 +642,7 @@ if ($id > 0)
/*
* Last invoices
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$facturestatic = new Facture($db);
@@ -723,13 +723,13 @@ if ($id > 0)
*/
print '<div class="tabsAction">';
if ($conf->propal->enabled && $user->rights->propal->creer)
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
{
$langs->load("propal");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
}
if ($conf->commande->enabled && $user->rights->commande->creer)
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
{
$langs->load("orders");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a>';
@@ -741,7 +741,7 @@ if ($id > 0)
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a>';
}
if ($conf->ficheinter->enabled && $user->rights->ficheinter->creer)
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
{
$langs->load("fichinter");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a>';
@@ -750,13 +750,13 @@ if ($id > 0)
// Add invoice
if ($user->societe_id == 0)
{
if ($conf->deplacement->enabled)
if (! empty($conf->deplacement->enabled))
{
$langs->load("trips");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a>';
}
if ($conf->facture->enabled)
if (! empty($conf->facture->enabled))
{
if ($user->rights->facture->creer)
{
@@ -772,7 +772,7 @@ if ($id > 0)
}
// Add action
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
if ($user->rights->agenda->myactions->create)
{

View File

@@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! $user->rights->societe->lire) accessforbidden();
@@ -80,7 +80,7 @@ $now=dol_now();
$form = new Form($db);
$formfile = new FormFile($db);
$companystatic=new Societe($db);
if ($conf->propal->enabled) $propalstatic=new Propal($db);
if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db);
llxHeader();
@@ -89,15 +89,15 @@ print_fiche_titre($langs->trans("CustomerArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr>';
if (($conf->propal->enabled && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire))
if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) ||
(! empty($conf->contrat->enabled) && $user->rights->contrat->lire) ||
(! empty($conf->commande->enabled) && $user->rights->commande->lire))
{
print '<td valign="top" width="30%" class="notopnoleft">';
}
// Recherche Propal
if ($conf->propal->enabled && $user->rights->propal->lire)
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
@@ -116,7 +116,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
/*
* Recherche Contrat
*/
if ($conf->contrat->enabled && $user->rights->contrat->lire)
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{
$var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">';
@@ -135,7 +135,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
/*
* Draft proposals
*/
if ($conf->propal->enabled && $user->rights->propal->lire)
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
@@ -200,7 +200,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
/*
* Draft orders
*/
if ($conf->commande->enabled && $user->rights->commande->lire)
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$langs->load("orders");
@@ -255,9 +255,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
}
}
if (($conf->propal->enabled && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire))
if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) ||
(! empty($conf->contrat->enabled) && $user->rights->contrat->lire) ||
(! empty($conf->commande->enabled) && $user->rights->commande->lire))
{
print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">';
@@ -276,7 +276,7 @@ $max=3;
/*
* Last modified customers or prospects
*/
if ($conf->societe->enabled && $user->rights->societe->lire)
if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
{
$langs->load("boxes");
@@ -336,7 +336,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
}
// Last suppliers
if ($conf->fournisseur->enabled && $user->rights->societe->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
{
$langs->load("boxes");
@@ -408,7 +408,7 @@ if ($user->rights->agenda->myactions->read)
/*
* Last contracts
*/
if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
{
$langs->load("contracts");
@@ -466,7 +466,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
/*
* Opened proposals
*/
if ($conf->propal->enabled && $user->rights->propal->lire)
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
@@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
print "</td>";

View File

@@ -145,7 +145,7 @@ if ($result)
// Filter on categories
$moreforfilter='';
if ($conf->categorie->enabled)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);

View File

@@ -178,7 +178,7 @@ if ($object->fetch($id) >= 0)
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/liste.php">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/liste.php">'.$langs->trans("BackToList").'</a>';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';

View File

@@ -440,9 +440,9 @@ if ($action == 'add')
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailBody"));
if (! $object->titre) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $mesg)
{
@@ -526,8 +526,8 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
$object->bgcolor = trim($_POST["bgcolor"]);
$object->bgimage = trim($_POST["bgimage"]);
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailBody"));
if (! $object->sujet) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTopic"));
if (! $object->body) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailMessage"));
if (! $mesg)
{

View File

@@ -714,6 +714,8 @@ else if ($action == "addline" && $user->rights->propal->creer)
}
}
$desc='';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
@@ -734,8 +736,7 @@ else if ($action == "addline" && $user->rights->propal->creer)
$desc = $prod->description;
}
$desc.= ($desc && ! empty($product_desc)) ? ((dol_textishtml($desc) || dol_textishtml($product_desc))?"<br />\n":"\n") : "";
$desc.= $product_desc;
$desc=dol_concatdesc($desc,$product_desc);
}
$type = $prod->type;
@@ -911,7 +912,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
0,
$fournprice,
$buying_price,
$label
$label,
$type
);
if ($result >= 0)
@@ -1231,7 +1233,7 @@ else if ($action == 'validate')
}
$text=$langs->trans('ConfirmValidateProp',$numref);
if ($conf->notification->enabled)
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
@@ -1640,7 +1642,7 @@ if ($object->statut == 0 && $user->rights->propal->creer)
$object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager);
@@ -1738,7 +1740,7 @@ if ($action != 'presend')
// Create an invoice and classify billed
if ($object->statut == 2 && $user->societe_id == 0)
{
if ($conf->facture->enabled && $user->rights->facture->creer)
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
}

View File

@@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('propal');
$langs->load("bills");

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
@@ -352,7 +352,7 @@ class Propal extends CommonObject
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -463,9 +463,10 @@ class Propal extends CommonObject
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price without tax
* @param string $label ???
* @param int $type 0/1=Product/service
* @return int 0 if OK, <0 if KO
*/
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $type=0)
{
global $conf,$user,$langs;
@@ -491,7 +492,7 @@ class Propal extends CommonObject
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2780,6 +2781,8 @@ class PropaleLigne
$sql.= " , total_ht=".price2num($this->total_ht)."";
$sql.= " , total_tva=".price2num($this->total_tva)."";
$sql.= " , total_ttc=".price2num($this->total_ttc)."";
$sql.= " , total_localtax1=".price2num($this->total_localtax1)."";
$sql.= " , total_localtax2=".price2num($this->total_localtax2)."";
}
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";

View File

@@ -164,12 +164,11 @@ if ($object->id > 0)
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propale->creer,50,$object);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propal->creer,50,$object);
// List of document
$param='&id='.$object->id;
$formfile->list_of_documents($filearray,$object,'propal',$param);
$formfile->list_of_documents($filearray,$object,'propal');
}
else
{

View File

@@ -151,7 +151,7 @@ else
/*
* Draft proposals
*/
if ($conf->propal->enabled)
if (! empty($conf->propal->enabled))
{
$sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
@@ -257,7 +257,7 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
print "</td>";
@@ -369,7 +369,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
* Proposals to process
*/
/*
if ($conf->propal->enabled)
if (! empty($conf->propal->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
@@ -418,7 +418,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -441,7 +441,7 @@ if ($conf->propal->enabled)
/*
* Proposal that are in a shipping process
*/
/*if ($conf->propal->enabled)
/*if (! empty($conf->propal->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@@ -490,7 +490,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';

View File

@@ -35,7 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('companies');
$langs->load('propal');
@@ -319,7 +320,7 @@ if ($result)
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td></tr></table>';
if ($objp->client == 1)

View File

@@ -217,11 +217,11 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
//if (empty($socid))
//{
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
@@ -246,7 +246,7 @@ if (empty($socid))
print '</table>';
print '</form>';
print '<br><br>';
}
//}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/prospect/class/prospect.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$langs->load('companies');
$langs->load('projects');
@@ -152,7 +152,7 @@ if ($socid > 0)
print '</tr>';
// Multiprice level
if ($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
@@ -181,7 +181,7 @@ if ($socid > 0)
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent
if ($conf->adherent->enabled)
if (! empty($conf->adherent->enabled))
{
$langs->load("members");
$langs->load("users");
@@ -225,7 +225,7 @@ if ($socid > 0)
/*
* Last proposals
*/
if ($conf->propal->enabled && $user->rights->propale->lire)
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$propal_static=new Propal($db);
@@ -297,13 +297,13 @@ if ($socid > 0)
print '<div class="tabsAction">';
if ($conf->propal->enabled && $user->rights->propale->creer)
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
}
// Add action
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
if ($user->rights->agenda->myactions->create)
{

View File

@@ -50,7 +50,7 @@ print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
if ($conf->propal->enabled)
if (! empty($conf->propal->enabled))
{
$var=false;
print '<table class="noborder nohover" width="100%">';
@@ -111,7 +111,7 @@ if ($resql)
/*
* Liste des propal brouillons
*/
if ($conf->propal->enabled && $user->rights->propale->lire)
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
@@ -164,13 +164,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
*/
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
if ($conf->agenda->enabled) show_array_actions_to_do(10);
if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10);
/*
* Dernieres propales ouvertes
*
*/
if ($conf->propal->enabled && $user->rights->propale->lire)
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,";
$sql.= " p.rowid as propalid, p.total as total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";

View File

@@ -261,7 +261,7 @@ if ($resql)
// Filter on categories
$moreforfilter='';
if ($conf->categorie->enabled)
if (! empty($conf->categorie->enabled))
{
$moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);

View File

@@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("companies");
$langs->load('other');
if ($conf->facture->enabled) $langs->load("bills");
if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check
$socid = $_GET["socid"];

View File

@@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("companies");
if ($conf->facture->enabled) $langs->load("bills");
if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check
$socid = $_GET["socid"];

View File

@@ -29,8 +29,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('orders');
$langs->load('propal');

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
@@ -237,7 +237,7 @@ class Commande extends CommonOrder
if (! $error)
{
// If stock is incremented on validate order, we must increment it
if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
if ($result >= 0 && ! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -351,7 +351,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -534,7 +534,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -999,6 +999,7 @@ class Commande extends CommonOrder
* @param int $fk_parent_line Parent line
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price (without tax)
* @param string $label Label
* @return int >0 if OK, <0 if KO
*
* @see add_product
@@ -1054,7 +1055,7 @@ class Commande extends CommonOrder
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits,$type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2159,6 +2160,7 @@ class Commande extends CommonOrder
* @param int $skip_update_total Skip update of total
* @param int $fk_fournprice Id supplier price
* @param int $pa_ht Buying price (without tax)
* @param string $label Label
* @return int < 0 if KO, > 0 if OK
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')
@@ -2192,7 +2194,7 @@ class Commande extends CommonOrder
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2538,7 +2540,7 @@ class Commande extends CommonOrder
$result='';
if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id;
if ($short) return $url;
@@ -2682,7 +2684,7 @@ class Commande extends CommonOrder
$line->total_ht=100;
$line->total_ttc=119.6;
$line->total_tva=19.6;
$line->remise_percent=00;
$line->remise_percent=0;
}
$prodid = rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
@@ -2841,13 +2843,15 @@ class OrderLine
var $localtax2_tx; // Local tax 2
var $subprice; // U.P. HT (example 100)
var $remise_percent; // % for line discount (example 20%)
var $fk_remise_except;
var $rang = 0;
var $fk_fournprice;
var $pa_ht;
var $marge_tx;
var $marque_tx;
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
var $special_code = 0;
var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
var $total_localtax1; // Total local tax 1 for the line
@@ -3140,11 +3144,11 @@ class OrderLine
$sql.= " , total_ht=".price2num($this->total_ht)."";
$sql.= " , total_tva=".price2num($this->total_tva)."";
$sql.= " , total_ttc=".price2num($this->total_ttc)."";
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
$sql.= " , total_localtax2=".price2num($this->total_localtax2);
}
$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null");
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";
$sql.= " , total_localtax1=".price2num($this->total_localtax1);
$sql.= " , total_localtax2=".price2num($this->total_localtax2);
$sql.= " , info_bits=".$this->info_bits;
$sql.= " , date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null");
$sql.= " , date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");

View File

@@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@@ -618,6 +618,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
}
}
$desc='';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
@@ -638,8 +640,7 @@ else if ($action == 'addline' && $user->rights->commande->creer)
$desc = $prod->description;
}
$desc.= ($desc && ! empty($product_desc)) ? ((dol_textishtml($desc) || dol_textishtml($product_desc))?"<br />\n":"\n") : "";
$desc.= $product_desc;
$desc=dol_concatdesc($desc,$product_desc);
}
$type = $prod->type;
@@ -1462,7 +1463,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Date de livraison
print "<tr><td>".$langs->trans("DeliveryDate").'</td><td colspan="2">';
if ($conf->global->DATE_LIVRAISON_WEEK_DELAY)
if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY))
{
$datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
}
@@ -1699,7 +1700,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
}
$text=$langs->trans('ConfirmValidateOrder',$numref);
if ($conf->notification->enabled)
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
@@ -1808,7 +1809,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
* Commande
*/
$nbrow=9;
if ($conf->projet->enabled) $nbrow++;
if (! empty($conf->projet->enabled)) $nbrow++;
//Local taxes
if ($mysoc->country_code=='ES')
@@ -2153,7 +2154,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@@ -2201,7 +2202,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Ship
$numshipping=0;
if ($conf->expedition->enabled)
if (! empty($conf->expedition->enabled))
{
$numshipping = $object->nb_expedition();
@@ -2235,7 +2236,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Create bill and Classify billed
if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed)
if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed)
{
if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
{

View File

@@ -165,7 +165,7 @@ else
/*
* Draft orders
*/
if ($conf->commande->enabled)
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@@ -262,7 +262,7 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -282,7 +282,7 @@ else dol_print_error($db);
/*
* Orders to process
*/
if ($conf->commande->enabled)
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
@@ -331,7 +331,7 @@ if ($conf->commande->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -353,7 +353,7 @@ if ($conf->commande->enabled)
/*
* Orders thar are in a shipping process
*/
if ($conf->commande->enabled)
if (! empty($conf->commande->enabled))
{
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@@ -402,7 +402,7 @@ if ($conf->commande->enabled)
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';

View File

@@ -308,7 +308,7 @@ if ($resql)
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -319,6 +319,8 @@ if ($resql)
$companystatic->client=$objp->client;
print '<td>';
print $companystatic->getNomUrl(1,'customer');
print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">';
print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom,'object_bill').'</a>';
print '</td>';
print '<td>'.$objp->ref_client.'</td>';

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
@@ -34,21 +34,25 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
$langs->load('orderstoinvoice@orderstoinvoice');
$sref=GETPOST('sref');
$sref_client=GETPOST('sref_client');
$sall=GETPOST('sall');
$socid=GETPOST('socid','int');
if (! $user->rights->facture->creer)
if (! $user->rights->facture->creer)
accessforbidden();
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$sref = GETPOST('sref');
$sref_client = GETPOST('sref_client');
$sall = GETPOST('sall');
$socid = GETPOST('socid','int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
if (! $sortfield) $sortfield='c.rowid';
@@ -120,19 +124,15 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$_POST['originid']=$orders_id[0];
}
$sall=isset($_GET['sall'])?trim($_GET['sall']):trim($_POST['sall']);
$projectid=isset($_GET['projectid'])?$_GET['projectid']:0;
$id =(GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$ref =GETPOST('ref');
$socid =GETPOST('socid');
$action =GETPOST('action');
$confirm =GETPOST('confirm');
$lineid =GETPOST('lineid');
$userid =GETPOST('userid');
$search_ref =GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref');
$projectid = GETPOST('projectid','int')?GETPOST('projectid','int'):0;
$lineid = GETPOST('lineid','int');
$userid = GETPOST('userid','int');
$search_ref = GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref');
$closeOrders = GETPOST('autocloseorders') != '' ? true : false;
// Security check
$fieldid = isset($_GET["ref"])?'facnumber':'rowid';
$fieldid = GETPOST('ref','alpha')?'facnumber':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
@@ -216,8 +216,10 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$result=$srcobject->fetch($orders_id[$ii]);
if ($result > 0)
{
$srcobject->classer_facturee();
$srcobject->setStatut(3);
if($closeOrders) {
$srcobject->classer_facturee();
$srcobject->setStatut(3);
}
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
$fk_parent_line=0;
@@ -384,6 +386,7 @@ if ($action == 'create')
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
@@ -403,6 +406,7 @@ if ($action == 'create')
print $desc;
print '</td></tr>'."\n";
print '</table>';
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$html->select_date(0,'','','','',"add",1,1);
@@ -416,7 +420,7 @@ if ($action == 'create')
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
@@ -445,7 +449,7 @@ if ($action == 'create')
$result=$srcobject->fetch($sel);
if ($result > 0)
{
$commandes.= $srcobject->ref." ";
$commandes.= $srcobject->ref.", ";
}
}
print $commandes;
@@ -463,20 +467,20 @@ if ($action == 'create')
}
print '</table>';
print '</td></tr>';
while ($i < $n)
{
print '<input type="hidden" name="orders_to_invoice[]" value="'.$orders_id[$i].'">';
$i++;
}
print "</table>\n";
// Button "Create Draft"
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></center>';
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></center>';
print "</form>\n";
print '</td></tr>';
print "</table>\n";
}
@@ -496,35 +500,18 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
});
</script>
<?php
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE c.fk_soc = s.rowid';
// Which invoice to show
if ($viewstatut <> '')
{
if ($viewstatut < 4 && $viewstatut > -2)
{
$sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
if ($viewstatut == 3)
{
$sql.= ' AND c.facture = 0'; // need to create invoice
}
}
if ($viewstatut == 4)
{
$sql.= ' AND c.facture = 1'; // invoice created
}
if ($viewstatut == -2) // To process
{
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
}
}
$sql.= ' AND s.entity = '.$conf->entity;
$sql.= ' WHERE c.entity = '.$conf->entity;
$sql.= ' AND c.fk_soc = s.rowid';
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($sref)
@@ -535,18 +522,18 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
}
//Date filter
if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
if (!empty($sref_client))
{
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$resql = $db->query($sql);
if ($resql)
{
if ($socid)
@@ -559,19 +546,21 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
$title = $langs->trans('ListOfOrders');
}
$title.=' - '.$langs->trans('StatusOrderToBillShort');
$title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill');
$num = $db->num_rows($resql);
print_fiche_titre($title);
$i = 0;
$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
// Company
print '<h3>';
$companystatic->id=$socid;
$companystatic->nom=$soc->nom;
print $companystatic->getNomUrl(1,'customer');
print '</h3>';
if (! empty($socid))
{
// Company
$companystatic->id=$socid;
$companystatic->nom=$soc->nom;
print '<h3>'.$companystatic->getNomUrl(1,'customer').'</h3>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),'orderstoinvoice.php','c.ref','','&amp;socid='.$socid,'',$sortfield,$sortorder);
@@ -581,7 +570,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '</tr>';
// Lignes des champs de filtre
print '<form method="get" action="orderstoinvoice.php">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
@@ -593,88 +582,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
//print '<td class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
//DATE ORDER
print '<td class="liste_titre" align="center">';
print $period;
print '</td>';
//DATE DELIVERY
print '<td class="liste_titre" align="center">';
print $periodely;
print '</td>';
//SEARCH BUTTON
print '</td><td align="right" class="liste_titre">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
//ALL/NONE
print '<td class="liste_titre" align="center">';
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>';
print '</td></tr>';
print '</form>';
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
$var=True;
$generic_commande = new Commande($db);
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
$generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut);
print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
print '<td>'.$objp->ref_client.'</td>';
// Order date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_commande),'day');
print '</td>';
//Delivery date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_livraison),'day');
print '</td>';
// Statut
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
// Checkbox
print '<td align="center">';
print '<input class="flat checkformerge" type="checkbox" name="orders_to_invoice[]" value="'.$objp->rowid.'">';
print '</td>' ;
print '</tr>';
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print '</table>';
/*
* Boutons actions
*/
@@ -683,7 +672,9 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="origin" value="commande"><br>';
print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
print '<input type="submit" class="butAction" value='.$langs->trans("GenerateBill").'>';
print '<input type="submit" class="button" value='.$langs->trans("GenerateBill").'>';
print '<center><br><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
print '</div>';
print '</form>';
$db->free($resql);
}

View File

@@ -238,11 +238,11 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
//if (empty($socid))
//{
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
@@ -268,7 +268,7 @@ if (empty($socid))
print '</table>';
print '</form>';
print '<br><br>';
}
//}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -42,6 +42,7 @@ if (GETPOST('commissionBase'))
if (dolibarr_set_const($db, 'COMMISSION_BASE', GETPOST('commissionBase'), 'string', 0, '', $conf->entity) > 0)
{
$conf->global->COMMISSION_BASE = GETPOST('commissionBase');
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else
{
@@ -179,10 +180,12 @@ print '</td>';
print '</tr>';
print '</table>';
print '<br>';
print '</form>';
dol_fiche_end();
print '<br>';
llxFooter();
$db->close();

View File

@@ -429,11 +429,11 @@ if ($id > 0 || ! empty($ref))
$sql.= ", s.rowid as socid, s.nom as thirdparty";
}
/*
if ($mode_search && $conf->adherent->enabled)
if ($mode_search && ! empty($conf->adherent->enabled))
{
}
if ($mode_search && $conf->tax->enabled)
if ($mode_search && ! empty($conf->tax->enabled))
{
}
@@ -445,12 +445,12 @@ if ($id > 0 || ! empty($ref))
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu1.url_id = s.rowid";
}
if ($mode_search && $conf->tax->enabled)
if ($mode_search && ! empty($conf->tax->enabled))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid";
}
if ($mode_search && $conf->adherent->enabled)
if ($mode_search && ! empty($conf->adherent->enabled))
{
// TODO Mettre jointure sur adherent pour recherche sur un adherent
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'";

View File

@@ -281,7 +281,7 @@ if ($action == 'create')
print '</td></tr>';
// Accountancy code
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
{
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
@@ -563,7 +563,7 @@ else
print '</td></tr>';
// Accountancy code
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)
if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
{
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';

View File

@@ -32,7 +32,7 @@ $langs->load("banks");
$langs->load("compta");
$langs->load("bills");
$langs->load("categories");
if ($conf->adherent->enabled) $langs->load("members");
if (! empty($conf->adherent->enabled)) $langs->load("members");
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));

View File

@@ -27,7 +27,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -489,7 +489,7 @@ else if ($id)
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr>';

View File

@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load("companies");
$langs->load("donations");
@@ -280,7 +280,7 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">';
$nbrows=11;
if ($conf->projet->enabled) $nbrows++;
if (! empty($conf->projet->enabled)) $nbrows++;
// Date
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
@@ -318,7 +318,7 @@ if ($action == 'create')
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
print "</td></tr>\n";
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
// Si module projet actif
print "<tr><td>".$langs->trans("Project")."</td><td>";
@@ -368,7 +368,7 @@ if (! empty($id) && $action == 'edit')
print '</tr>';
$nbrows=12;
if ($conf->projet->enabled) $nbrows++;
if (! empty($conf->projet->enabled)) $nbrows++;
// Date
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
@@ -458,7 +458,7 @@ if (! empty($id) && $action != 'edit')
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$nbrows=12;
if ($conf->projet->enabled) $nbrows++;
if (! empty($conf->projet->enabled)) $nbrows++;
// Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
@@ -502,7 +502,7 @@ if (! empty($id) && $action != 'edit')
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
}

View File

@@ -53,7 +53,7 @@ if (!$user->rights->don->lire) accessforbidden();
* View
*/
if ($conf->projet->enabled) $projectstatic=new Project($db);
if (! empty($conf->projet->enabled)) $projectstatic=new Project($db);
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
@@ -160,7 +160,7 @@ if ($resql)
print "<td>".$objp->societe."</td>\n";
print "<td>".$donationstatic->getFullName($langs)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>';
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
print "<td>";
if ($objp->pid)

View File

@@ -1049,6 +1049,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
}
}
$desc='';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
@@ -1069,8 +1071,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$desc = $prod->description;
}
$desc.= ($desc && ! empty($product_desc)) ? ((dol_textishtml($desc) || dol_textishtml($product_desc))?"<br />\n":"\n") : "";
$desc.= $product_desc;
$desc=dol_concatdesc($desc,$product_desc);
}
if (! empty($prod->customcode) || ! empty($prod->country_code))
@@ -1882,7 +1883,7 @@ if ($action == 'create')
print '</td></tr>'."\n";
// Proforma
if ($conf->global->FACTURE_USE_PROFORMAT)
if (! empty($conf->global->FACTURE_USE_PROFORMAT))
{
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="4"'.(GETPOST('type')==4?' checked="checked"':'').'>';
@@ -1973,7 +1974,7 @@ if ($action == 'create')
print '</td></tr>';
// Project
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
@@ -2080,7 +2081,7 @@ if ($action == 'create')
print '<td>'.$langs->trans('Qty').'</td>';
print '<td>'.$langs->trans('ReductionShort').'</td>';
print '<td> &nbsp; &nbsp; </td>';
if ($conf->service->enabled)
if (! empty($conf->service->enabled))
{
print '<td>'.$langs->trans('ServiceLimitedDuration').'</td>';
}
@@ -2090,7 +2091,7 @@ if ($action == 'create')
print '<tr>';
print '<td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES)
if (! empty($conf->global->PRODUIT_MULTIPRICES))
$form->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level);
else
$form->select_produits('','idprod'.$i,'',$conf->product->limit_size);
@@ -2099,7 +2100,7 @@ if ($action == 'create')
print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '<td>&nbsp;</td>';
// Si le module service est actif, on propose des dates de debut et fin a la ligne
if ($conf->service->enabled)
if (! empty($conf->service->enabled))
{
print '<td nowrap="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
@@ -2243,7 +2244,7 @@ else if ($id > 0 || ! empty($ref))
}
$text=$langs->trans('ConfirmValidateBill',$numref);
if ($conf->notification->enabled)
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
@@ -2624,8 +2625,8 @@ else if ($id > 0 || ! empty($ref))
*/
$nbrows=8; $nbcols=2;
if ($conf->projet->enabled) $nbrows++;
if ($conf->banque->enabled) $nbcols++;
if (! empty($conf->projet->enabled)) $nbrows++;
if (! empty($conf->banque->enabled)) $nbcols++;
//Local taxes
if ($mysoc->pays_code=='ES')
@@ -2642,7 +2643,7 @@ else if ($id > 0 || ! empty($ref))
print '<tr class="liste_titre">';
print '<td>'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td>'.$langs->trans('Type').'</td>';
if ($conf->banque->enabled) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
print '<td align="right">'.$langs->trans('Amount').'</td>';
print '<td width="18">&nbsp;</td>';
print '</tr>';
@@ -2679,7 +2680,7 @@ else if ($id > 0 || ! empty($ref))
print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
$label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label;
print '<td>'.$label.' '.$objp->num_paiement.'</td>';
if ($conf->banque->enabled)
if (! empty($conf->banque->enabled))
{
$bankaccountstatic->id=$objp->baid;
$bankaccountstatic->ref=$objp->ref;
@@ -3016,7 +3017,7 @@ else if ($id > 0 || ! empty($ref))
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@@ -3268,7 +3269,7 @@ else if ($id > 0 || ! empty($ref))
$somethingshown=$object->showLinkedObjectBlock();
// Link for paypal payment
if ($conf->paypal->enabled && $object->statut != 0)
if (! empty($conf->paypal->enabled) && $object->statut != 0)
{
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice',$object->ref);

View File

@@ -30,7 +30,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("bills");
@@ -288,7 +288,7 @@ if ($id > 0 || ! empty($ref))
print '</td>';
$nbrows=5;
if ($conf->projet->enabled) $nbrows++;
if (! empty($conf->projet->enabled)) $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
/*
@@ -366,7 +366,7 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
// Projet
if ($conf->projet->enabled)
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
print '<tr>';

View File

@@ -62,6 +62,8 @@ class FactureRec extends Facture
var $rang;
var $special_code;
var $usenewprice=0;
var $lines=array();
@@ -114,6 +116,7 @@ class FactureRec extends Facture
$sql.= ", fk_projet";
$sql.= ", fk_cond_reglement";
$sql.= ", fk_mode_reglement";
$sql.= ", usenewprice";
$sql.= ") VALUES (";
$sql.= "'".$this->titre."'";
$sql.= ", '".$facsrc->socid."'";
@@ -126,6 +129,7 @@ class FactureRec extends Facture
$sql.= ", ".(! empty($facsrc->fk_project)?"'".$facsrc->fk_project."'":"null");
$sql.= ", '".$facsrc->cond_reglement_id."'";
$sql.= ", '".$facsrc->mode_reglement_id."'";
$sql.= ", '".$this->usenewprice."'";
$sql.= ")";
if ($this->db->query($sql))

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
@@ -691,7 +691,7 @@ class Facture extends CommonInvoice
// Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
{
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
}
@@ -1330,6 +1330,8 @@ class Facture extends CommonInvoice
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code;
if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id;
$cdr_nbjour=0; $cdr_fdm=0; $cdr_decalage=0;
$sqltemp = 'SELECT c.fdm,c.nbjour,c.decalage';
$sqltemp.= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c';
if (is_numeric($cond_reglement)) $sqltemp.= " WHERE c.rowid=".$cond_reglement;
@@ -1809,7 +1811,7 @@ class Facture extends CommonInvoice
if ($result)
{
// Si on decremente le produit principal et ses composants a la validation de facture, on réincrement
if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL)
if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -1925,7 +1927,7 @@ class Facture extends CommonInvoice
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -2063,7 +2065,7 @@ class Facture extends CommonInvoice
// Calculate total with, without tax and tax from qty, pu, remise_percent and txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@@ -3446,11 +3448,11 @@ class FactureLigne
$sql.= ",total_ht=".price2num($this->total_ht)."";
$sql.= ",total_tva=".price2num($this->total_tva)."";
$sql.= ",total_ttc=".price2num($this->total_ttc)."";
$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
$sql.= ",total_localtax2=".price2num($this->total_localtax2)."";
}
$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";
$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
$sql.= ",total_localtax2=".price2num($this->total_localtax2)."";
$sql.= ",fk_parent_line=".($this->fk_parent_line>0?$this->fk_parent_line:"null");
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
$sql.= " WHERE rowid = ".$this->rowid;

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -73,6 +73,7 @@ if ($action == 'add')
{
$object->titre = GETPOST('titre', 'alpha');
$object->note = GETPOST('comment');
$object->usenewprice = GETPOST('usenewprice');
if ($object->create($user, $id) > 0)
{
@@ -122,11 +123,14 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="facid" value="'.$invoice->id.'">';
$rowspan=4;
if (! empty($conf->projet->enabled) && $invoice->fk_project > 0) $rowspan++;
print '<table class="border" width="100%">';
$invoice->fetch_thirdparty();
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$invoice->client->getNomUrl(1).'</td>';
print '<tr><td>'.$langs->trans("Customer").'</td><td>'.$invoice->client->getNomUrl(1,'customer').'</td>';
print '<td>';
//print $langs->trans("NotePrivate");
print '</td></tr>';
@@ -135,7 +139,7 @@ if ($action == 'create')
print '<input class="flat" type="text" name="titre" size="16" value="'.$_POST["titre"].'">';
print '</td>';
print '<td rowspan="4" valign="top">';
print '<td rowspan="'.$rowspan.'" valign="top">';
print '<textarea class="flat" name="note" wrap="soft" cols="60" rows="'.ROWS_4.'"></textarea>';
print '</td></tr>';
@@ -149,7 +153,7 @@ if ($action == 'create')
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$invoice->id, $facture->mode_reglement_id, 'none');
print "</td></tr>";
if (! empty($conf->projet->enabled))
if (! empty($conf->projet->enabled) && $invoice->fk_project > 0)
{
print "<tr><td>".$langs->trans("Project")."</td><td>";
if ($invoice->fk_project > 0)
@@ -208,7 +212,7 @@ if ($action == 'create')
print '<td width="8%" align="center">'.$langs->trans("Qty").'</td>';
print '<td width="8%" align="right">'.$langs->trans("ReductionShort").'</td>';
print '<td width="12%" align="right">'.$langs->trans("PriceU").'</td>';
print '<td width="12%" align="right">N.P.</td>';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print '<td width="12%" align="right">'.$langs->trans("CurrentProductPrice").'</td>';
print "</tr>\n";
}
$var=True;
@@ -223,21 +227,19 @@ if ($action == 'create')
}
$var=!$var;
print "<tr $bc[$var]>";
print "<tr ".$bc[$var].">";
// Show product and description
$type=(isset($objp->product_type)?$objp->product_type:$objp->fk_product_type);
if ($objp->fk_product)
if ($objp->fk_product > 0)
{
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
// Show product and description
$product_static->type=$objp->fk_product_type;
$product_static->id=$objp->fk_product;
$product_static->ref=$objp->ref;
$product_static->fetch($objp->fk_product); // We need all information later
$text=$product_static->getNomUrl(1);
$text.= ' - '.(! empty($objp->custom_label)?$objp->custom_label:$objp->product_label);
$description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description));
@@ -277,7 +279,7 @@ if ($action == 'create')
}
print '<td align="center">'.$objp->tva_tx.' %</td>';
print '<td align="center">'.vatrate($objp->tva_tx).'%</td>';
print '<td align="center">'.$objp->qty.'</td>';
if ($objp->remise_percent > 0)
{
@@ -290,14 +292,19 @@ if ($action == 'create')
print '<td align="right">'.price($objp->subprice)."</td>\n";
if ($objp->fk_product > 0 && $objp->subprice <> $product->price)
// Price of product
if (empty($conf->global->PRODUIT_MULTIPRICES))
{
print '<td align="right">'.price($product->price)."</td>\n";
$flag_different_price++;
}
else
{
print '<td>&nbsp;</td>';
if ($objp->fk_product > 0)
{
$flag_price_may_change++;
$prodprice=$product_static->price; // price HT
print '<td align="right">'.price($prodprice)."</td>\n";
}
else
{
print '<td>&nbsp;</td>';
}
}
print "</tr>";
@@ -315,21 +322,13 @@ if ($action == 'create')
print "</table>";
print '</td></tr>';
// TODO not used
if ($flag_different_price)
if ($flag_price_may_change)
{
print '<tr><td colspan="3" align="left">';
print '<select name="deal_price">';
if ($flag_different_price>1)
{
print '<option value="new">Prendre en compte les nouveaux prix</option>';
print '<option value="old">Utiliser les anciens prix</option>';
}
else
{
print '<option value="new">Prendre en compte le nouveau prix</option>';
print '<option value="old">Utiliser l\'ancien prix</option>';
}
print '<select name="usenewprice" class="flat">';
print '<option value="0">'.$langs->trans("AlwaysUseFixedPrice").'</option>';
print '<option value="1" disabled="disabled">'.$langs->trans("AlwaysUseNewPrice").'</option>';
print '</select>';
print '</td></tr>';
}
@@ -340,7 +339,7 @@ if ($action == 'create')
}
else
{
print "Erreur facture $invoice->id inexistante";
dol_print_error('',"Error, no invoice ".$invoice->id);
}
}
else
@@ -348,7 +347,6 @@ else
/*
* View mode
*/
if ($id > 0)
{
if ($object->fetch($id) > 0)
@@ -366,7 +364,7 @@ else
print '<td colspan="4">'.$object->titre.'</td>';
print '<tr><td>'.$langs->trans("Customer").'</td>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td>';
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1,'customer').'</td>';
print "<td>". $langs->trans("PaymentConditions") ." : ";
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id,'none');
print "</td></tr>";

View File

@@ -88,7 +88,7 @@ if ($action == "builddoc" && $user->rights->facture->lire)
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
// Add all others
foreach($files as $file)
@@ -340,7 +340,7 @@ if ($resql)
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
print '</tr></table>';
@@ -365,8 +365,10 @@ if ($resql)
// Checkbox
print '<td align="center">';
if ($foundpdf) print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
else print '&nbsp;';
if (! empty($formfile->numoffiles))
print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
else
print '&nbsp;';
print '</td>' ;
print "</tr>\n";

View File

@@ -341,7 +341,7 @@ if ($resql)
$filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>';
print '</tr>';
print '</table>';

View File

@@ -457,11 +457,15 @@ if ($object->id > 0)
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
}
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("MakeWithdrawRequest").'</a>';
}
print "</div><br>\n";
print $langs->trans("DoStandingOrdersBeforePayments").'<br>';
print $langs->trans("DoStandingOrdersBeforePayments").'<br><br>';
/*

View File

@@ -214,11 +214,11 @@ complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
if (empty($socid))
{
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
print '<table class="notopnoleftnopadd" width="100%"><tr>';
print '<td align="center" valign="top">';
//if (empty($socid))
//{
// Show filter box
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
@@ -244,7 +244,7 @@ if (empty($socid))
print '</table>';
print '</form>';
print '<br><br>';
}
//}
print '<table class="border" width="100%">';
print '<tr height="24">';

View File

@@ -27,9 +27,9 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
// L'espace compta/treso doit toujours etre actif car c'est un espace partage
// par de nombreux modules (banque, facture, commande a facturer, etc...) independamment
@@ -40,7 +40,7 @@ if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/
$langs->load("compta");
$langs->load("bills");
if ($conf->commande->enabled) $langs->load("orders");
if (! empty($conf->commande->enabled)) $langs->load("orders");
// Security check
$socid='';
@@ -108,7 +108,7 @@ $max=3;
/*
* Search invoices
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/facture/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -125,7 +125,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/*
* Search supplier invoices
*/
if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
{
print '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -142,7 +142,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
/*
* Search donations
*/
if ($conf->don->enabled && $user->rights->don->lire)
if (! empty($conf->don->enabled) && $user->rights->don->lire)
{
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/liste.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -159,7 +159,7 @@ if ($conf->don->enabled && $user->rights->don->lire)
/*
* Search expenses
*/
if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
{
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/deplacement/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -176,7 +176,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
/**
* Draft customers invoices
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid";
@@ -250,7 +250,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/**
* Draft suppliers invoices
*/
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid";
@@ -320,7 +320,7 @@ print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">';
// Last modified customer invoices
if ($conf->facture->enabled && $user->rights->facture->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$langs->load("boxes");
$facstatic=new Facture($db);
@@ -349,7 +349,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastCustomerBills",$max).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
print '<td width="16">&nbsp;</td>';
@@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$filename=dol_sanitizeFileName($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -388,7 +388,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$thirdpartystatic->client=1;
print $thirdpartystatic->getNomUrl(1,'customer',44);
print '</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@@ -404,7 +404,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';
@@ -419,7 +419,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
// Last modified supplier invoices
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
$langs->load("boxes");
$facstatic=new FactureFournisseur($db);
@@ -446,7 +446,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastSupplierBills",$max).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
print '<td width="16">&nbsp;</td>';
@@ -469,7 +469,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$thirdpartystatic->fournisseur=1;
print $thirdpartystatic->getNomUrl(1,'supplier',44);
print '</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
@@ -484,7 +484,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';
@@ -498,7 +498,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
// Last donations
if ($conf->don->enabled && $user->rights->societe->lire)
if (! empty($conf->don->enabled) && $user->rights->societe->lire)
{
include_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
@@ -633,7 +633,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
/**
* Social contributions to pay
*/
if ($conf->tax->enabled && $user->rights->tax->charges->lire)
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
if (!$socid)
{
@@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire)
/*
* Customers orders to be billed
*/
if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire)
if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
$commandestatic=new Commande($db);
$langs->load("orders");
@@ -742,7 +742,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?status=3&afacturer=1">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("ToBill").'</td>';
print '<td align="center" width="16">&nbsp;</td>';
@@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -781,7 +781,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
$societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
print '<td>'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'</td>';
@@ -795,7 +795,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($tot_ht).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($tot_ht).'</td>';
print '<td align="right">'.price($tot_ttc).'</td>';
print '<td align="right">'.price($tot_tobill).'</td>';
print '<td>&nbsp;</td>';
@@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
/*
* Unpaid customers invoices
*/
if ($conf->facture->enabled && $user->rights->facture->lire)
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$facstatic=new Facture($db);
@@ -840,7 +840,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Received").'</td>';
print '<td width="16">&nbsp;</td>';
@@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
{
$obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
@@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$filename=dol_sanitizeFileName($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
@@ -881,7 +880,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@@ -895,7 +894,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>';
@@ -904,7 +903,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';
@@ -919,7 +918,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/*
* Unpayed supplier invoices
*/
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
$facstatic=new FactureFournisseur($db);
@@ -945,7 +944,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>';
print '<td width="16">&nbsp;</td>';
@@ -968,7 +967,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$societestatic->nom=$obj->nom;
$societestatic->client=0;
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
@@ -981,7 +980,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
}
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>';
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>';
@@ -990,7 +989,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
else
{
$colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++;
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
}
print '</table><br>';

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -95,7 +96,7 @@ $sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.libelle,";
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,";
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
$sql.= " p.rowid as pid, p.ref as ref, p.accountancy_code_buy,";
$sql.= " ct.accountancy_code";
$sql.= " ct.accountancy_code_buy as account_tva";
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn_det fd";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
@@ -130,7 +131,7 @@ if ($result)
if($obj->product_type == 0) $compta_prod = (! empty($conf->global->COMPTA_PRODUCT_BUY_ACCOUNT))?$conf->global->COMPTA_PRODUCT_BUY_ACCOUNT:$langs->trans("CodeNotDef");
else $compta_prod = (! empty($conf->global->COMPTA_SERVICE_BUY_ACCOUNT))?$conf->global->COMPTA_SERVICE_BUY_ACCOUNT:$langs->trans("CodeNotDef");
}
$compta_tva = (! empty($obj->accountancy_code))?$obj->accountancy_code:$cpttva;
$compta_tva = (! empty($obj->account_tva))?$obj->account_tva:$cpttva;
$tabfac[$obj->rowid]["date"] = $obj->datef;
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
@@ -158,7 +159,7 @@ print "<tr class=\"liste_titre\">";
print "<td>".$langs->trans("Date")."</td>";
print "<td>".$langs->trans("Piece").' ('.$langs->trans("InvoiceRef").")</td>";
print "<td>".$langs->trans("Account")."</td>";
print "<t><td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "<td>".$langs->trans("Type")."</td><td align='right'>".$langs->trans("Debit")."</td><td align='right'>".$langs->trans("Credit")."</td>";
print "</tr>\n";
$var=true;

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