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

This commit is contained in:
Laurent Destailleur 2017-09-02 01:29:12 +02:00
commit 09e9254f35
310 changed files with 13895 additions and 3230 deletions

View File

@ -9,7 +9,7 @@ NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes) NEW: Add module "Product variant" (like red, blue for the product shoes)
NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC) NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC)
NEW: Add a tracking id into mass emailing. NEW: Add a tracking id into mass emailing.
NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST). NEW: Tax system more compatible with the new tax rollout in India (IGST / CGST / SGST).
NEW: Add calculation function for Loan schedule NEW: Add calculation function for Loan schedule
NEW: Add "depends on" and "required by" into module informations NEW: Add "depends on" and "required by" into module informations
NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO
@ -23,7 +23,7 @@ NEW: add property to show warnings when activating modules
NEW: add rapport file for supplier paiement NEW: add rapport file for supplier paiement
NEW: Add statistics on supplier tab. NEW: Add statistics on supplier tab.
NEW: Add tooltip help on shipment weight and volume calculation NEW: Add tooltip help on shipment weight and volume calculation
NEW: An external module can hook and add mass actions NEW: An external module can hook and add mass actions.
NEW: Better reponsive design NEW: Better reponsive design
NEW: Bookmarks are into a combo list. NEW: Bookmarks are into a combo list.
NEW: Bulk actions available on supplier orders NEW: Bulk actions available on supplier orders
@ -153,6 +153,37 @@ content by doing a print into function, sometimes by returning content into "res
hook specifications so you must return output into "resprint". hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document
FIX: #7156
FIX: #7173
FIX: #7224
FIX: #7226
FIX: #7239
FIX: add supplierproposaldet without price (new product)
FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page.
FIX: Bad tax calculation with expense report
FIX: Best buy price calculation
FIX: Buying prices must always be in positive value.
FIX: calculate correct remain to pay for planned bank transactions
FIX: delete linked element on facture rec
FIX: edit sociale was emptying label
FIX: Error when updating thirdparty not returned
FIX: holidays with postgresql like on rowid integer
FIX: id of user not saved when making a payment of expense report
FIX: invoice page list
FIX: invoice situation VAT total rounding into PDF crabe
FIX: PgSQL compatibility.
FIX: remove order rights on invoice page
FIX: status were wrong on product referent list
FIX: supplier id was not passed to hooks
FIX: Support of vat code when using price per customer
FIX: User id correction on holiday request
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
FIX: we have to check if contact doesn't already exist on add_contact() function
FIX: We should be able to insert data with value '0' into const
FIX: install process with DoliWamp
***** ChangeLog for 5.0.4 compared to 5.0.3 ***** ***** ChangeLog for 5.0.4 compared to 5.0.3 *****
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working FIX: #6541 since 4.0.4 to 5.0.0 autofill zip/town not working
@ -657,7 +688,7 @@ NEW: Disabled users are striked.
NEW: Enhance navigation of project module NEW: Enhance navigation of project module
NEW: fichinter lines ordered by rang AND DATE NEW: fichinter lines ordered by rang AND DATE
NEW: hidden conf to use input file multiple from mail form NEW: hidden conf to use input file multiple from mail form
NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param). NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param).
NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy. NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy.
NEW: If error is reported during migration process, you can ignore it to avoid to be locked. NEW: If error is reported during migration process, you can ignore it to avoid to be locked.

View File

@ -49,6 +49,8 @@ if (empty($argv[1]))
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1; exit -1;
} }
parse_str($argv[1]);
$i=0; $i=0;
while ($i < $argc) while ($i < $argc)
{ {
@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp)
print "\n"; print "\n";
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml'; //$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
$outputdir=dirname(__FILE__).'/../htdocs/install'; $outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n"; print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1); dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
$checksumconcat=array(); $checksumconcat=array();

View File

@ -1,8 +1,10 @@
README (English) README (English)
################################################## ##################################################
Install script for Virtualmin Pro Install script for Virtualmin Professional / GPL
################################################## ##################################################
This script will install automatically Dolibarr from Virtualmin Pro This script will install automatically Dolibarr from Virtualmin.
http://www.virtualmin.com (Included in the professional version and can be added in the GPL version)
https://www.virtualmin.com
http://www.webmin.com/virtualmin.html http://www.webmin.com/virtualmin.html

View File

@ -1,7 +1,7 @@
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# \file dolibarr.pl # \file dolibarr.pl
# \brief Dolibarr script install for Virtualmin Pro # \brief Dolibarr script install for Virtualmin Pro
# \author (c)2009-2015 Regis Houssin <regis.houssin@capnetworks.com> # \author (c)2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -30,7 +30,12 @@ return "Regis Houssin";
# script_dolibarr_versions() # script_dolibarr_versions()
sub script_dolibarr_versions sub script_dolibarr_versions
{ {
return ( "3.8.1", "3.7.1", "3.6.4", "3.5.7" ); return ( "5.0.4", "4.0.6", "3.9.4" );
}
sub script_dolibarr_release
{
return 2; # for mysqli fix
} }
sub script_dolibarr_category sub script_dolibarr_category
@ -177,9 +182,9 @@ if ($opts->{'newdb'} && !$upgrade) {
local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2); local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2);
local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d); local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d);
local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1); local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1);
local $dbphptype = $dbtype eq "mysql" && $version >= 3.6 ? "mysql" : local $dbphptype = $dbtype eq "mysql" && $version < 3.6 ? "mysql" :
$dbtype eq "mysql" ? "mysqli" : "pgsql"; $dbtype eq "mysql" ? "mysqli" : "pgsql";
local $dbhost = &get_database_host($dbtype); local $dbhost = &get_database_host($dbtype, $d);
local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass); local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass);
return (0, "Database connection failed : $dberr") if ($dberr); return (0, "Database connection failed : $dberr") if ($dberr);
@ -206,9 +211,6 @@ $pgcharset = $tmpl->{'postgres_encoding'};
$charset = $dbtype eq "mysql" ? $mycharset : $pgcharset; $charset = $dbtype eq "mysql" ? $mycharset : $pgcharset;
$collate = $dbtype eq "mysql" ? $mycollate : "C"; $collate = $dbtype eq "mysql" ? $mycollate : "C";
# Install filename
local $step = $version >= 3.8 ? "step" : "etape";
$path = &script_path_url($d, $opts); $path = &script_path_url($d, $opts);
if ($path =~ /^https:/ || $d->{'ssl'}) { if ($path =~ /^https:/ || $d->{'ssl'}) {
$url = "https://$d->{'dom'}"; $url = "https://$d->{'dom'}";
@ -222,15 +224,11 @@ if ($opts->{'path'} =~ /\w/) {
if (!$upgrade) { if (!$upgrade) {
local $cdef = "$opts->{'dir'}/conf/conf.php.example"; local $cdef = "$opts->{'dir'}/conf/conf.php.example";
&run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile)); &copy_source_dest_as_domain_user($d, $cdef, $cfile);
&set_permissions_as_domain_user($d, 0777, $cfiledir); &set_permissions_as_domain_user($d, 0777, $cfiledir);
&set_permissions_as_domain_user($d, 0666, $cfile); &copy_source_dest_as_domain_user($d, $cfile);
&run_as_domain_user($d, "mkdir ".quotemeta($docdir)); &run_as_domain_user($d, "mkdir ".quotemeta($docdir));
&set_permissions_as_domain_user($d, 0777, $docdir); &set_permissions_as_domain_user($d, 0777, $docdir);
if (!$version >= 3.7.2) {
&run_as_domain_user($d, "mkdir ".quotemeta($altdir));
&set_permissions_as_domain_user($d, 0777, $altdir);
}
} }
else { else {
# Preserve old config file, documents and custom directory # Preserve old config file, documents and custom directory
@ -266,7 +264,8 @@ if ($upgrade) {
[ "versionfrom", $upgrade->{'version'} ], [ "versionfrom", $upgrade->{'version'} ],
[ "versionto", $ver ], [ "versionto", $ver ],
); );
local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); local $p = $ver >= 3.8 ? "step5" : "etape5";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err); return (-1, "Dolibarr wizard failed : $err") if ($err);
# Remove the installation directory. # Remove the installation directory.
@ -289,15 +288,17 @@ else {
[ "main_force_https", $opts->{'forcehttps'} ], [ "main_force_https", $opts->{'forcehttps'} ],
[ "dolibarr_main_db_character_set", $charset ], [ "dolibarr_main_db_character_set", $charset ],
[ "dolibarr_main_db_collation", $collate ], [ "dolibarr_main_db_collation", $collate ],
[ "main_use_alt_dir", "1" ], [ "usealternaterootdir", "1" ],
[ "main_alt_dir_name", "custom" ], [ "main_alt_dir_name", "custom" ],
); );
local $err = &call_dolibarr_wizard_page(\@params, $step."1", $d, $opts); local $p = $ver >= 3.8 ? "step1" : "etape1";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err); return (-1, "Dolibarr wizard failed : $err") if ($err);
# Second page (Populate database) # Second page (Populate database)
local @params = ( [ "action", "set" ] ); local @params = ( [ "action", "set" ] );
local $err = &call_dolibarr_wizard_page(\@params, $step."2", $d, $opts); local $p = $ver >= 3.8 ? "step2" : "etape2";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err); return (-1, "Dolibarr wizard failed : $err") if ($err);
# Third page (Add administrator account) # Third page (Add administrator account)
@ -306,7 +307,8 @@ else {
[ "pass", $dompass ], [ "pass", $dompass ],
[ "pass_verif", $dompass ], [ "pass_verif", $dompass ],
); );
local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts); local $p = $ver >= 3.8 ? "step5" : "etape5";
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
return (-1, "Dolibarr wizard failed : $err") if ($err); return (-1, "Dolibarr wizard failed : $err") if ($err);
# Remove the installation directory and protect config file. # Remove the installation directory and protect config file.
@ -384,7 +386,10 @@ sub script_dolibarr_check_latest
{ {
local ($ver) = @_; local ($ver) = @_;
local @vers = &osdn_package_versions("dolibarr", local @vers = &osdn_package_versions("dolibarr",
$ver >= 3.8 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : $ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 4.0 ? "dolibarr\\-(4\\.0\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.9 ? "dolibarr\\-(3\\.9\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.8 ? "dolibarr\\-(3\\.8\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" : $ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" : $ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" :
$ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" : $ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" :

File diff suppressed because one or more lines are too long

View File

@ -192,6 +192,7 @@ export list="
--ignore-table=$base.llx_cabinetmed_c_ccam --ignore-table=$base.llx_cabinetmed_c_ccam
--ignore-table=$base.llx_cabinetmed_c_examconclusion --ignore-table=$base.llx_cabinetmed_c_examconclusion
--ignore-table=$base.llx_cabinetmed_cons --ignore-table=$base.llx_cabinetmed_cons
--ignore-table=$base.llx_cabinetmed_cons_extrafields
--ignore-table=$base.llx_cabinetmed_diaglec --ignore-table=$base.llx_cabinetmed_diaglec
--ignore-table=$base.llx_cabinetmed_examaut --ignore-table=$base.llx_cabinetmed_examaut
--ignore-table=$base.llx_cabinetmed_exambio --ignore-table=$base.llx_cabinetmed_exambio
@ -207,7 +208,18 @@ export list="
--ignore-table=$base.llx_dolicloud_customers --ignore-table=$base.llx_dolicloud_customers
--ignore-table=$base.llx_dolicloud_stats --ignore-table=$base.llx_dolicloud_stats
--ignore-table=$base.llx_dolicloud_emailstemplates --ignore-table=$base.llx_dolicloud_emailstemplates
--ignore-table=$base.llx_dolireport_column
--ignore-table=$base.llx_dolireport_criteria
--ignore-table=$base.llx_dolireport_graph
--ignore-table=$base.llx_dolireport_plot
--ignore-table=$base.llx_dolireport_report
--ignore-table=$base.llx_domain --ignore-table=$base.llx_domain
--ignore-table=$base.llx_ecommerce_commande
--ignore-table=$base.llx_ecommerce_facture
--ignore-table=$base.llx_ecommerce_product
--ignore-table=$base.llx_ecommerce_site
--ignore-table=$base.llx_ecommerce_societe
--ignore-table=$base.llx_ecommerce_socpeople
--ignore-table=$base.llx_element_rang --ignore-table=$base.llx_element_rang
--ignore-table=$base.llx_entity --ignore-table=$base.llx_entity
--ignore-table=$base.llx_filemanager_roots --ignore-table=$base.llx_filemanager_roots
@ -215,6 +227,8 @@ export list="
--ignore-table=$base.llx_google_maps --ignore-table=$base.llx_google_maps
--ignore-table=$base.llx_milestone --ignore-table=$base.llx_milestone
--ignore-table=$base.llx_monitoring_probes --ignore-table=$base.llx_monitoring_probes
--ignore-table=$base.llx_m
--ignore-table=$base.llx_m_extrafields
--ignore-table=$base.llx_notes --ignore-table=$base.llx_notes
--ignore-table=$base.llx_pos_cash --ignore-table=$base.llx_pos_cash
--ignore-table=$base.llx_pos_control_cash --ignore-table=$base.llx_pos_control_cash

View File

@ -145,12 +145,12 @@ else if ($action == 'update') {
* View * View
*/ */
$form = new Form($db);
$title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card"); $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card");
$helpurl = ""; $helpurl = "";
llxHeader("",$title,$helpurl); llxHeader("",$title,$helpurl);
$form = new Form($db);
if ($action == 'create') if ($action == 'create')
{ {
print load_fiche_titre($langs->trans("NewFiscalYear")); print load_fiche_titre($langs->trans("NewFiscalYear"));

View File

@ -4,7 +4,7 @@ use Stripe\BankAccount;
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>

View File

@ -158,6 +158,7 @@ class Adherent extends CommonObject
$from=$conf->email_from; $from=$conf->email_from;
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
// Send email (substitutionarray must be done just before this)
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; 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); $mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
if ($mailfile->sendfile()) if ($mailfile->sendfile())

View File

@ -114,7 +114,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
if ($result < 0) if ($result < 0)
{ {
$langs->load("errors"); $langs->load("errors");
$errmsg=$langs->trans($company->error);
setEventMessages($company->error, $company->errors, 'errors'); setEventMessages($company->error, $company->errors, 'errors');
} }
else else
@ -124,7 +123,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
} }
else else
{ {
$errmsg=$object->error; setEventMessages($object->error, $object->errors, 'errors');
} }
} }
@ -212,7 +211,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]); $paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
} }
$subscription=$_POST["subscription"]; // Amount of subscription $subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription
$label=$_POST["label"]; $label=$_POST["label"];
// Payment informations // Payment informations
@ -230,6 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription")); $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription'; $action='addsubscription';
} }
if (GETPOST('end') && ! $datesubend) if (GETPOST('end') && ! $datesubend)
@ -237,6 +237,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription")); $errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription'; $action='addsubscription';
} }
if (! $datesubend) if (! $datesubend)
@ -247,16 +248,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$error++; $error++;
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")); $errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
setEventMessages($errmsg, null, 'errors');
$action='addsubscription'; $action='addsubscription';
} }
$amount = price2num(GETPOST("subscription",'alpha'));
// Check if a payment is mandatory or not // Check if a payment is mandatory or not
if (! $error && $adht->subscription) // Member type need subscriptions if (! $error && $adht->subscription) // Member type need subscriptions
{ {
if (! is_numeric($_POST["subscription"])) if (! is_numeric($amount))
{ {
// If field is '' or not a numeric value // If field is '' or not a numeric value
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
setEventMessages($errmsg, null, 'errors');
$error++; $error++;
$action='addsubscription'; $action='addsubscription';
} }
@ -274,7 +279,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
} }
if ($errmsg) $action='addsubscription'; if ($errmsg)
{
setEventMessages($errmsg, null, 'errors');
$action='addsubscription';
}
} }
} }
} }
@ -320,6 +329,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$error++; $error++;
$errmsg=$db->lasterror(); $errmsg=$db->lasterror();
setEventMessages($errmsg, null, 'errors');
} }
} }
else else
@ -327,6 +337,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++; $error++;
$errmsg=$acct->error; $errmsg=$acct->error;
$errmsgs=$acct->errors; $errmsgs=$acct->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
} }
} }
else else
@ -334,6 +345,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++; $error++;
$errmsg=$acct->error; $errmsg=$acct->error;
$errmsgs=$acct->errors; $errmsgs=$acct->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
} }
} }
@ -352,6 +364,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$langs->load("errors"); $langs->load("errors");
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst"); $errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
setEventMessages($errmsg, null, 'errors');
$error++; $error++;
} }
} }
@ -362,6 +375,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$errmsg=$customer->error; $errmsg=$customer->error;
$errmsgs=$acct->errors; $errmsgs=$acct->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++; $error++;
} }
} }
@ -379,6 +393,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$error++; $error++;
$errmsg='ErrorNoPaymentTermRECEPFound'; $errmsg='ErrorNoPaymentTermRECEPFound';
setEventMessages($errmsg, null, 'errors');
} }
} }
$invoice->socid=$object->fk_soc; $invoice->socid=$object->fk_soc;
@ -396,6 +411,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;
$errmsgs=$invoice->errors; $errmsgs=$invoice->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++; $error++;
} }
} }
@ -416,6 +432,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if ($result <= 0) if ($result <= 0)
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;
setEventMessages($errmsg, null, 'errors');
$error++; $error++;
} }
} }
@ -428,6 +445,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$errmsg=$invoice->error; $errmsg=$invoice->error;
$errmsgs=$invoice->errors; $errmsgs=$invoice->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++; $error++;
} }
} }
@ -455,6 +473,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
{ {
$errmsg=$paiement->error; $errmsg=$paiement->error;
$errmsgs=$paiement->errors; $errmsgs=$paiement->errors;
setEventMessages($errmsg, $errmsgs, 'errors');
$error++; $error++;
} }
} }
@ -536,6 +555,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if ($result < 0) if ($result < 0)
{ {
$errmsg=$object->error; $errmsg=$object->error;
setEventMessages($errmsg, null, 'errors');
} }
} }

View File

@ -131,12 +131,11 @@ if (preg_match('/del_(.*)/',$action,$reg))
* View * View
*/ */
llxHeader(); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -67,11 +67,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
$textobject=$langs->transnoentitiesnoconv("Agenda"); $textobject=$langs->transnoentitiesnoconv("Agenda");
llxHeader('',$langs->trans("AgendaSetup")); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
$head=agenda_prepare_head(); $head=agenda_prepare_head();

View File

@ -125,11 +125,11 @@ $formother=new FormOther($db);
$arrayofjs=array(); $arrayofjs=array();
$arrayofcss=array(); $arrayofcss=array();
llxHeader('',$langs->trans("AgendaSetup"),'','',0,0,$arrayofjs,$arrayofcss); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
llxHeader('',$langs->trans("AgendaSetup"),$wikihelp,'',0,0,$arrayofjs,$arrayofcss);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print '<br>';
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -42,7 +42,7 @@ $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$param = GETPOST('param','alpha'); $param = GETPOST('param','alpha');
$cancel = GETPOST('cancel','alpha'); $cancel = GETPOST('cancel','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type = 'action'; $type = 'action';
@ -174,12 +174,12 @@ else if ($action == 'setdoc')
$formactions=new FormActions($db); $formactions=new FormActions($db);
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader();
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
llxHeader('', $langs->trans("AgendaSetup"),$wikihelp);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print "<br>\n";
@ -273,7 +273,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<td align="center">'."\n"; print '<td align="center">'."\n";
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
} }
@ -286,7 +286,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -298,7 +298,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -71,11 +71,11 @@ if ($actionsave)
if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY=100; if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY=100;
llxHeader(); $wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup'); print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
print '<br>';
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@ -43,7 +43,7 @@ if (!$user->admin)
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type = 'bankaccount'; $type = 'bankaccount';
@ -322,7 +322,7 @@ foreach ($dirmodels as $reldir)
print '</td>'; print '</td>';
} else { } else {
print '<td align="center">' . "\n"; print '<td align="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
print "</td>"; print "</td>";
} }
@ -331,7 +331,7 @@ foreach ($dirmodels as $reldir)
if ($conf->global->BANKADDON_PDF == $name) { if ($conf->global->BANKADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} else { } else {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
} }
print '</td>'; print '</td>';

View File

@ -190,7 +190,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -46,7 +46,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type = 'order'; $type = 'order';
@ -464,7 +464,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -476,7 +476,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -37,7 +37,7 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='contract'; $type='contract';
if (empty($conf->global->CONTRACT_ADDON)) if (empty($conf->global->CONTRACT_ADDON))
@ -397,7 +397,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -409,7 +409,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -45,7 +45,7 @@ if (! $user->admin)
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
$value=GETPOST('value','alpha'); $value=GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='shipping'; $type='shipping';
if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$file.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"),'switch_off'); print img_picto($langs->trans("Disabled"),'switch_off');
print '</a>'; print '</a>';
} }
@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -414,7 +414,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';
@ -440,7 +440,7 @@ foreach ($dirmodels as $reldir)
print '<td align="center">'; print '<td align="center">';
if ($module->type == 'pdf') if ($module->type == 'pdf')
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
} }
else else
{ {

View File

@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='expensereport'; $type='expensereport';
@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
print "</td>"; print "</td>";
@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -418,7 +418,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='ficheinter'; $type='ficheinter';
@ -431,7 +431,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
print "</td>"; print "</td>";
@ -439,7 +439,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -44,7 +44,7 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='delivery'; $type='delivery';
@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def)) if (in_array($name, $def))
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
print "</td>"; print "</td>";
@ -393,7 +393,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -405,7 +405,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send')
} }
$substitutionarrayfortest=array( $substitutionarrayfortest=array(
'__LOGIN__' => $user->login, '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => 'TESTIdRecord', '__ID__' => 'RecipientIdRecord',
'__EMAIL__' => 'TESTEMail', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
'__LASTNAME__' => 'TESTLastname', '__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
'__FIRSTNAME__' => 'TESTFirstname', '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), '__LOGIN__' => 'RecipientLogin',
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet '__LASTNAME__' => 'RecipientLastname',
'__FIRSTNAME__' => 'RecipientFirstname',
'__ADDRESS__'=> 'RecipientAddress',
'__ZIP__'=> 'RecipientZip',
'__TOWN_'=> 'RecipientTown',
'__COUNTRY__'=> 'RecipientCountry'
); );
complete_substitutions_array($substitutionarrayfortest, $langs); complete_substitutions_array($substitutionarrayfortest, $langs);

View File

@ -845,7 +845,7 @@ if ($mode == 'deploy')
{ {
dol_fiche_head($head, $mode, '', -1); dol_fiche_head($head, $mode, '', -1);
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);
$allowonlineinstall=true; $allowonlineinstall=true;
$allowfromweb=1; $allowfromweb=1;
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
@ -872,7 +872,6 @@ if ($mode == 'deploy')
} }
else else
{ {
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
$allowfromweb=0; $allowfromweb=0;
} }
@ -936,7 +935,6 @@ if ($mode == 'deploy')
} }
} }
if (! empty($result['return'])) if (! empty($result['return']))
{ {
print '<br>'; print '<br>';
@ -950,8 +948,6 @@ if ($mode == 'deploy')
dol_fiche_end(); dol_fiche_end();
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='invoice'; $type='invoice';
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php'; if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
@ -188,7 +188,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012-2105 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -75,6 +75,10 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;
} }
@ -249,6 +253,40 @@ if ($action == 'edit') // Edit
print '<br>'; print '<br>';
// Localtaxes
if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
{
$locales ='';
$text='';
if ($mysoc->useLocalTax(1))
{
$locales = $langs->transcountry("LT1",$mysoc->country_code);
$text ='<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . '</td><td>';
$text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1);
$text .= '</td></tr>';
}
if ($mysoc->useLocalTax(2))
{
$locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code);
$text.= '<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . '</td><td>';
$text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1);
$text.= '</td></tr>';
}
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
$var=true;
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print $text;
print '</table>';
print '<br>';
}
// Other // Other
print load_fiche_titre($langs->trans("Other"),'','').'<br>'; print load_fiche_titre($langs->trans("Other"),'','').'<br>';
$var=true; $var=true;
@ -444,6 +482,40 @@ else // Show
print '<br>'; print '<br>';
// Localtaxes
if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
{
$locales ='';
$text='';
if ($mysoc->useLocalTax(1))
{
$locales = $langs->transcountry("LT1",$mysoc->country_code);
$text ='<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . '</td><td>';
$text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1);
$text .= '</td></tr>';
}
if ($mysoc->useLocalTax(2))
{
$locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code);
$text.= '<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . '</td><td>';
$text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1);
$text.= '</td></tr>';
}
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
$var=true;
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print $text;
print '</table>';
print '<br>';
}
// Other // Other
print load_fiche_titre($langs->trans("Other"),'',''); print load_fiche_titre($langs->trans("Other"),'','');
$var=true; $var=true;

View File

@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='propal'; $type='propal';
/* /*
@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -455,7 +455,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -44,7 +44,7 @@ accessforbidden();
$type=GETPOST('type', 'alpha'); $type=GETPOST('type', 'alpha');
$value=GETPOST('value', 'alpha'); $value=GETPOST('value', 'alpha');
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$specimenthirdparty=new Societe($db); $specimenthirdparty=new Societe($db);
$specimenthirdparty->initAsSpecimen(); $specimenthirdparty->initAsSpecimen();
@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
//{ //{
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
/*} /*}
@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir)
{ {
//print img_picto($langs->trans("Default"),'on'); //print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -45,7 +45,7 @@ $type=GETPOST('type', 'alpha');
$value=GETPOST('value', 'alpha'); $value=GETPOST('value', 'alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$specimenthirdparty=new Societe($db); $specimenthirdparty=new Societe($db);
$specimenthirdparty->initAsSpecimen(); $specimenthirdparty->initAsSpecimen();
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
print '<td align="center">'."\n"; print '<td align="center">'."\n";
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">';
print img_picto($langs->trans("Enabled"),'switch_on'); print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>'; print '</a>';
} }
@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print '<td align="center">'."\n"; print '<td align="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='supplier_payment'; $type='supplier_payment';
@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value','alpha'); $value = GETPOST('value','alpha');
$label = GETPOST('label','alpha'); $label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha'); $scandir = GETPOST('scan_dir','alpha');
$type='supplier_proposal'; $type='supplier_proposal';
$error=0; $error=0;
@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir)
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir)
} }
else else
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
print '</td>'; print '</td>';

View File

@ -577,6 +577,11 @@ if ($action == 'mupdate')
} }
// Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
/* /*
* View * View
@ -709,7 +714,7 @@ if ($action == 'create')
// Location // Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{ {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth100" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>';
} }
// Assigned to // Assigned to
@ -965,7 +970,7 @@ if ($id > 0)
} }
// Title // Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$object->label.'"></td></tr>'; print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="minwidth100" value="'.$object->label.'"></td></tr>';
// Full day event // Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent?' checked':'').'></td></tr>'; print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent?' checked':'').'></td></tr>';
@ -1049,7 +1054,7 @@ if ($id > 0)
// Location // Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{ {
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>'; print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth100" value="'.$object->location.'"></td></tr>';
} }
// Assigned to // Assigned to
@ -1212,7 +1217,6 @@ if ($id > 0)
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>'; $out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
$linkback.=$out; $linkback.=$out;
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
// Thirdparty // Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); //$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
@ -1477,7 +1481,7 @@ if ($id > 0)
*/ */
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id; $filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->agenda->myactions->create; $genallowed=$user->rights->agenda->myactions->create;
$delallowed=$user->rights->agenda->myactions->delete; $delallowed=$user->rights->agenda->myactions->delete;

View File

@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
$object->substitutionarrayfortest=array( $object->substitutionarrayfortest=array(
'__ID__' => 'TESTIdRecord', '__ID__' => 'TESTIdRecord',
'__EMAIL__' => 'TESTEMail', //'__EMAIL__' => 'TESTEMail', // Done into "send" action
'__LASTNAME__' => 'TESTLastname', '__LASTNAME__' => 'TESTLastname',
'__FIRSTNAME__' => 'TESTFirstname', '__FIRSTNAME__' => 'TESTFirstname',
'__MAILTOEMAIL__' => 'TESTMailtoEmail', '__MAILTOEMAIL__' => 'TESTMailtoEmail',
@ -409,6 +409,8 @@ if (empty($reshook))
$msgishtml=-1; // Inconnu par defaut $msgishtml=-1; // Inconnu par defaut
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1; if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
$object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; // other are set at begin of page
// Pratique les substitutions sur le sujet et message // Pratique les substitutions sur le sujet et message
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest); $tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest); $tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);

View File

@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha');
$socid=''; $socid='';
if (! empty($user->societe_id)) if (! empty($user->societe_id))
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result = restrictedArea($user, 'propal', $id); $result = restrictedArea($user, 'propal', $id);

View File

@ -44,7 +44,6 @@ $ref = GETPOST('ref');
// Security check // Security check
if ($user->societe_id) if ($user->societe_id)
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result=restrictedArea($user,'commande',$id,''); $result=restrictedArea($user,'commande',$id,'');

View File

@ -3,7 +3,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -62,9 +62,7 @@ $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '',
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');
if ($page == -1) { if (empty($page) || $page == -1) { $page = 0; }
$page = 0;
}
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -491,22 +491,37 @@ foreach ($accounts as $key=>$type)
// Account number // Account number
if (! empty($arrayfields['b.account_number']['checked'])) if (! empty($arrayfields['b.account_number']['checked']))
{
print '<td>';
if (! empty($conf->accounting->enabled))
{ {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$acc->account_number); $accountingaccount->fetch('',$acc->account_number);
print $accountingaccount->getNomUrl(0,1,1,'',1);
print '<td>'.$accountingaccount->getNomUrl(0,1,1,'',1).'</td>'; }
else
{
print $acc->account_number;
}
print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Accountancy journal // Accountancy journal
if (! empty($arrayfields['b.fk_accountancy_journal']['checked'])) if (! empty($arrayfields['b.fk_accountancy_journal']['checked']))
{
print '<td>';
if (! empty($conf->accounting->enabled))
{ {
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($acc->fk_accountancy_journal); $accountingjournal->fetch($acc->fk_accountancy_journal);
print $accountingjournal->getNomUrl(0,1,1,'',1);
print '<td>'.$accountingjournal->getNomUrl(0,1,1,'',1).'</td>'; }
else
{
print '';
}
print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }

View File

@ -55,7 +55,7 @@ if ($action == 'add_confirm')
if (! $label) if (! $label)
{ {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
} }
if (! $amount) if (! $amount)

View File

@ -648,12 +648,13 @@ if (empty($reshook))
if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION) if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION)
{ {
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT // If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT
$sql = 'SELECT SUM(pf.amount) as total_paiements $sql = 'SELECT SUM(pf.amount) as total_paiements
FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms'; WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) dol_print_error($db);
$res = $db->fetch_object($resql); $res = $db->fetch_object($resql);
$total_paiements = $res->total_paiements; $total_paiements = $res->total_paiements;
@ -4103,11 +4104,11 @@ else if ($id > 0 || ! empty($ref))
if ($objectidnext) { if ($objectidnext) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>'; print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else { } else {
if ($resteapayer == 0) { //if ($resteapayer == 0) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>'; // print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else { //} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
} //}
} }
} }

View File

@ -783,7 +783,7 @@ class Facture extends CommonInvoice
$facture->situation_final = $this->situation_final; $facture->situation_final = $this->situation_final;
// Loop on each line of new invoice // Loop on each line of new invoice
foreach($facture->lines as $i => $line) foreach($facture->lines as $i => $tmpline)
{ {
$facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid;
if ($invertdetail) if ($invertdetail)

View File

@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha');
// Security check // Security check
if ($user->societe_id) if ($user->societe_id)
{ {
$action='';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$result=restrictedArea($user,'facture',$id,''); $result=restrictedArea($user,'facture',$id,'');
@ -72,9 +71,11 @@ if ($object->fetch($id))
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
} }
/* /*
* Actions * Actions
*/ */
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';

View File

@ -39,6 +39,8 @@ $ref=GETPOST("ref",'alpha');
* View * View
*/ */
$form = new Form($db);
$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info'); $title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; $helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl); llxHeader('', $title, $helpurl);

View File

@ -60,6 +60,8 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer)
* View * View
*/ */
$form = new Form($db);
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
$title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Info"); $title = $langs->trans("SocialContribution") . ' - ' . $langs->trans("Info");

View File

@ -249,7 +249,7 @@ else
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok) if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{ {
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'; //$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id; if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1'; $out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1';
//$out.=$langs->trans("AddAnAction").' '; //$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew'); //$out.=img_picto($langs->trans("AddAnAction"),'filenew');

View File

@ -1831,13 +1831,13 @@ class Contrat extends CommonObject
$text.=': &nbsp; &nbsp; '; $text.=': &nbsp; &nbsp; ';
} }
$text.=($mode == 7?'<div class="inline-block">':''); $text.=($mode == 7?'<div class="inline-block">':'');
$text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.$line->LibStatut(0,3)).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?' &nbsp; ':'') : ''; $text.=($mode != 7 || $this->nbofserviceswait > 0) ? ($this->nbofserviceswait.$line->LibStatut(0,3,-1,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesopened || $this->nbofservicesexpired || $this->nbofservicesclosed)?' &nbsp; ':'') : '';
$text.=($mode == 7?'</div><div class="inline-block">':''); $text.=($mode == 7?'</div><div class="inline-block">':'');
$text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.$line->LibStatut(4,3,0)).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?' &nbsp; ':'') : ''; $text.=($mode != 7 || $this->nbofservicesopened > 0) ? ($this->nbofservicesopened.$line->LibStatut(4,3,0,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesexpired || $this->nbofservicesclosed)?' &nbsp; ':'') : '';
$text.=($mode == 7?'</div><div class="inline-block">':''); $text.=($mode == 7?'</div><div class="inline-block">':'');
$text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.$line->LibStatut(4,3,1)).(($mode != 7 || $this->nbofservicesclosed)?' &nbsp; ':'') : ''; $text.=($mode != 7 || $this->nbofservicesexpired > 0) ? ($this->nbofservicesexpired.$line->LibStatut(4,3,1,'class="paddingleft2 inline-block valigntextbottom"')).(($mode != 7 || $this->nbofservicesclosed)?' &nbsp; ':'') : '';
$text.=($mode == 7?'</div><div class="inline-block">':''); $text.=($mode == 7?'</div><div class="inline-block">':'');
$text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.$line->LibStatut(5,3)) : ''; $text.=($mode != 7 || $this->nbofservicesclosed > 0) ? ($this->nbofservicesclosed.$line->LibStatut(5,3,-1,'class="paddingleft2 inline-block valigntextbottom"')) : '';
$text.=($mode == 7?'</div>':''); $text.=($mode == 7?'</div>':'');
return $text; return $text;
} }
@ -2509,9 +2509,10 @@ class ContratLigne extends CommonObjectLine
* @param int $statut Id statut * @param int $statut Id statut
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown * @param int $expired 0=Not expired, 1=Expired, -1=Both or unknown
* @param string $moreatt More attribute
* @return string Libelle * @return string Libelle
*/ */
function LibStatut($statut,$mode,$expired=-1) function LibStatut($statut,$mode,$expired=-1,$moreatt='')
{ {
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
@ -2541,11 +2542,11 @@ class ContratLigne extends CommonObjectLine
} }
if ($mode == 3) if ($mode == 3)
{ {
if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); } if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0',$moreatt); }
if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); } if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4',$moreatt); }
if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4'); } if ($statut == 4 && $expired == 0) { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4',$moreatt); }
if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); } if ($statut == 4 && $expired == 1) { return img_picto($langs->trans('ServiceStatusLate'),'statut3',$moreatt); }
if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); } if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6',$moreatt); }
} }
if ($mode == 4) if ($mode == 4)
{ {

View File

@ -39,8 +39,10 @@ $result = restrictedArea($user, 'contrat', $id, '');
/* /*
* View * View
*/ */
$form = new Form($db);
llxHeader('',$langs->trans("Contract"),""); llxHeader('',$langs->trans("Contract"),"");

View File

@ -154,6 +154,7 @@ if (empty($reshook))
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{ {
$search_product_category=0;
$search_name=""; $search_name="";
$search_contract=""; $search_contract="";
$search_service=""; $search_service="";
@ -176,6 +177,8 @@ if (empty($reshook))
$filter_opcloture=""; $filter_opcloture="";
$mode=''; $mode='';
$filter=''; $filter='';
$toselect='';
$search_array_options=array();
} }
} }

View File

@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
if ($object->id) if ($object->id)
{ {
if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask'));
else else
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
} }
} }
elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC))

View File

@ -82,7 +82,7 @@ if (! $error && $massaction == 'confirm_presend')
$result=$objecttmp->fetch($toselectid); $result=$objecttmp->fetch($toselectid);
if ($result > 0) if ($result > 0)
{ {
$listoinvoicesid[$toselectid]=$toselectid; $listofobjectid[$toselectid]=$toselectid;
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
$listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp;
@ -169,7 +169,7 @@ if (! $error && $massaction == 'confirm_presend')
//var_dump($listofobjectref);exit; //var_dump($listofobjectref);exit;
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
$listofqualifiedinvoice=array(); $listofqualifiedid=array();
$listofqualifiedref=array(); $listofqualifiedref=array();
foreach($listofobjectref[$thirdpartyid] as $objectid => $object) foreach($listofobjectref[$thirdpartyid] as $objectid => $object)
{ {
@ -223,7 +223,7 @@ if (! $error && $massaction == 'confirm_presend')
); );
} }
$listofqualifiedinvoice[$objectid]=$object; $listofqualifiedid[$objectid]=$object;
$listofqualifiedref[$objectid]=$object->ref; $listofqualifiedref[$objectid]=$object->ref;
} }
else else
@ -238,8 +238,8 @@ if (! $error && $massaction == 'confirm_presend')
//var_dump($listofqualifiedref); //var_dump($listofqualifiedref);
} }
// Loop on each qualified invoice of the thirdparty // Loop on each qualified objects of the thirdparty
if (count($listofqualifiedinvoice) > 0) if (count($listofqualifiedid) > 0)
{ {
$langs->load("commercial"); $langs->load("commercial");
@ -266,17 +266,35 @@ if (! $error && $massaction == 'confirm_presend')
$subject = GETPOST('subject'); $subject = GETPOST('subject');
$message = GETPOST('message'); $message = GETPOST('message');
$sendtocc = GETPOST('sentocc'); $sendtocc = GETPOST('sentocc');
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO); $sendtobcc = '';
if ($objectclass == 'Propale') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
if ($objectclass == 'Commande') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
if ($objectclass == 'Facture') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
if ($objectclass == 'Supplier_Proposal') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO);
if ($objectclass == 'CommandeFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO);
if ($objectclass == 'FactureFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO);
$substitutionarray=array( $substitutionarray=array(
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)), '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => join(', ',array_keys($listofqualifiedid)),
'__EMAIL__' => $thirdparty->email, '__EMAIL__' => $thirdparty->email,
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>', '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
'__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__ORDERREF__' => join(', ',$listofqualifiedref), // For backward compatibility
'__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility '__PROPREF__' => join(', ',$listofqualifiedref), // For backward compatibility
'__REF__' => join(', ',$listofqualifiedref), '__REF__' => join(', ',$listofqualifiedref),
'__REFCLIENT__' => $thirdparty->name '__REFCLIENT__' => $thirdparty->name,
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
/* not available on all object
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
'__ADDRESS__'=>(is_object($object)?$object->address:''),
'__ZIP__'=>(is_object($object)?$object->zip:''),
'__TOWN_'=>(is_object($object)?$object->town:''),
'__COUNTRY__'=>(is_object($object)?$object->country:''),
*/
); );
$subject=make_substitutions($subject, $substitutionarray); $subject=make_substitutions($subject, $substitutionarray);
@ -288,7 +306,7 @@ if (! $error && $massaction == 'confirm_presend')
//var_dump($filepath); //var_dump($filepath);
// Send mail // Send mail (substitutionarray must be done just before this)
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'); require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
if ($mailfile->error) if ($mailfile->error)
@ -305,7 +323,7 @@ if (! $error && $massaction == 'confirm_presend')
$error=0; $error=0;
// Insert logs into agenda // Insert logs into agenda
foreach($listofqualifiedinvoice as $invid => $object) foreach($listofqualifiedid as $objid => $object)
{ {
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP'; /*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
if ($objectclass == 'Commande') $actiontypecode='AC_COM'; if ($objectclass == 'Commande') $actiontypecode='AC_COM';
@ -328,7 +346,7 @@ if (! $error && $massaction == 'confirm_presend')
$object->sendtoid = 0; $object->sendtoid = 0;
$object->actionmsg = $actionmsg; // Long text $object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text $object->actionmsg2 = $actionmsg2; // Short text
$object->fk_element = $invid; $object->fk_element = $objid;
$object->elementtype = $object->element; $object->elementtype = $object->element;
// Appel des triggers // Appel des triggers
@ -403,7 +421,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
$result=$objecttmp->fetch($toselectid); $result=$objecttmp->fetch($toselectid);
if ($result > 0) if ($result > 0)
{ {
$listoinvoicesid[$toselectid]=$toselectid; $listofobjectid[$toselectid]=$toselectid;
$thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid;
$listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid;
$listofobjectref[$toselectid]=$objecttmp->ref; $listofobjectref[$toselectid]=$objecttmp->ref;
@ -411,7 +429,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se
} }
$arrayofinclusion=array(); $arrayofinclusion=array();
foreach($listofobjectref as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/'); foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote($tmppdf.'.pdf','/').'$';
$listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true);
// build list of files with full path // build list of files with full path

View File

@ -344,7 +344,29 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
} }
} }
// Send mail
$substitutionarray=array(
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
'__ID__' => (is_object($object)?$object->id:''),
'__EMAIL__' => $sendto,
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
'__REF__' => (is_object($object)?$object->ref:''),
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?dol_string_nohtmltag($user->signature):'')
/* not available on all object
/'__FIRSTNAME__'=>(is_object($object)?$object->firstname:''),
'__LASTNAME__'=>(is_object($object)?$object->lastname:''),
'__FULLNAME__'=>(is_object($object)?$object->getFullName($langs):''),
'__ADDRESS__'=>(is_object($object)?$object->address:''),
'__ZIP__'=>(is_object($object)?$object->zip:''),
'__TOWN_'=>(is_object($object)?$object->town:''),
'__COUNTRY__'=>(is_object($object)?$object->country:''),
*/
);
$subject=make_substitutions($subject, $substitutionarray);
$message=make_substitutions($message, $substitutionarray);
// Send mail (substitutionarray must be done just before this)
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid);
if ($mailfile->error) if ($mailfile->error)
{ {

View File

@ -97,267 +97,6 @@ class box_activity extends ModeleBoxes
$cumuldata = array(); $cumuldata = array();
// list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
// part 1
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh)
{
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " WHERE f.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$billurl="viewstatut=2&amp;paye=1&amp;year=".$data[$j]->annee;
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'text' => $data[$j]->nb,
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
// We add only for the current year
if ($data[$j]->annee == date("Y")) {
$totalnb += $data[$j]->nb;
$totalMnt += $data[$j]->Mnttot;
}
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
);
$line++;
$j++;
}
if (count($data)==0)
$this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
}
// part 2
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice2'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND paye=0";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$billurl="viewstatut=".$data[$j]->fk_statut."&amp;paye=0";
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
);
$line++;
$j++;
}
if ($num==0)
$this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
);
}
}
// list the summary of the orders
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
$cachedir = DOL_DATA_ROOT.'/commande/temp';
$filename = '/boxactivity-order'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " WHERE c.entity = ".$conf->entity;
$sql.= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
$sql.= " AND c.facture=0";
$sql.= " GROUP BY c.fk_statut";
$sql.= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
'logo' => 'object_order',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $commandestatic->LibStatut($data[$j]->fk_statut,0,3),
);
$line++;
$j++;
}
}
}
// list the summary of the propals // list the summary of the propals
if (! empty($conf->propal->enabled) && $user->rights->propale->lire) if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
@ -449,6 +188,267 @@ class box_activity extends ModeleBoxes
} }
} }
// list the summary of the orders
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
$cachedir = DOL_DATA_ROOT.'/commande/temp';
$filename = '/boxactivity-order'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " WHERE c.entity = ".$conf->entity;
$sql.= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
$sql.= " GROUP BY c.fk_statut";
$sql.= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
'logo' => 'object_order',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $commandestatic->LibStatut($data[$j]->fk_statut,0,3),
);
$line++;
$j++;
}
}
}
// list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
// part 1
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh)
{
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " WHERE f.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$billurl="search_status=2&amp;paye=1&amp;year=".$data[$j]->annee;
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'text' => $data[$j]->nb,
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
// We add only for the current year
if ($data[$j]->annee == date("Y")) {
$totalnb += $data[$j]->nb;
$totalMnt += $data[$j]->Mnttot;
}
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
);
$line++;
$j++;
}
if (count($data)==0)
$this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
}
// part 2
$cachedir = DOL_DATA_ROOT.'/facture/temp';
$filename = '/boxactivity-invoice2'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND paye=0";
$sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
$j++;
}
if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
dol_filecache($cachedir, $filename, $data);
}
$db->free($result);
} else {
dol_print_error($db);
}
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($cumuldata)) {
$billurl="search_status=".$data[$j]->fk_statut."&amp;paye=0";
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$line][1] = array(
'td' => '',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
);
$this->info_box_contents[$line][2] = array(
'td' => 'class="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
'td' => 'class="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
);
$line++;
$j++;
}
if ($num==0)
$this->info_box_contents[$line][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
);
}
}
// Add the sum in the bottom of the boxes // Add the sum in the bottom of the boxes
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"'); $this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead); $this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);

View File

@ -170,6 +170,16 @@ class CMailFile
$this->msgishtml = $msgishtml; $this->msgishtml = $msgishtml;
} }
global $dolibarr_main_url_root;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Replace relative /viewimage to absolute path
$msg = preg_replace('/src="'.preg_quote(DOL_URL_ROOT,'/').'\/viewimage\.php/ims', 'src="'.$urlwithroot.'/viewimage.php', $msg, -1, $nbrep);
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html. if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
// Detect images // Detect images

View File

@ -42,6 +42,7 @@ class CSMSFile
var $priority; var $priority;
var $class; var $class;
var $message; var $message;
var $nostop;
/** /**
@ -81,6 +82,7 @@ class CSMSFile
$this->priority=$priority; $this->priority=$priority;
$this->class=$class; $this->class=$class;
$this->message=$msg; $this->message=$msg;
$this->nostop=false;
} }
@ -107,6 +109,7 @@ class CSMSFile
if (empty($conf->global->MAIN_DISABLE_ALL_SMS)) if (empty($conf->global->MAIN_DISABLE_ALL_SMS))
{ {
// Action according to choosed sending method // Action according to choosed sending method
if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // Backward compatibility @deprecated if ($conf->global->MAIN_SMS_SENDMODE == 'ovh') // Backward compatibility @deprecated
{ {
@ -118,6 +121,7 @@ class CSMSFile
$sms->deferred=$this->deferred; $sms->deferred=$this->deferred;
$sms->priority=$this->priority; $sms->priority=$this->priority;
$sms->class=$this->class; $sms->class=$this->class;
$sms->nostop=$this->nostop;
$res=$sms->SmsSend(); $res=$sms->SmsSend();
if ($res <= 0) if ($res <= 0)
@ -129,7 +133,7 @@ class CSMSFile
{ {
dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG);
//var_dump($res); // 1973128 //var_dump($res); // 1973128
$this->dump_sms_result($res); if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res);
} }
} }
else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
@ -147,6 +151,7 @@ class CSMSFile
$sms->priority=$this->priority; $sms->priority=$this->priority;
$sms->class=$this->class; $sms->class=$this->class;
$sms->message=$this->message; $sms->message=$this->message;
$sms->nostop=$this->nostop;
$res=$sms->SmsSend(); $res=$sms->SmsSend();
$this->error = $sms->error; $this->error = $sms->error;
@ -159,7 +164,7 @@ class CSMSFile
{ {
dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG); dol_syslog("CSMSFile::sendfile: sms send success with id=".$res, LOG_DEBUG);
//var_dump($res); // 1973128 //var_dump($res); // 1973128
$this->dump_sms_result($res); if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res);
} }
} }
catch(Exception $e) catch(Exception $e)
@ -207,6 +212,7 @@ class CSMSFile
fputs($fp, "Priority: ".$this->priority."\n"); fputs($fp, "Priority: ".$this->priority."\n");
fputs($fp, "Class: ".$this->class."\n"); fputs($fp, "Class: ".$this->class."\n");
fputs($fp, "Deferred: ".$this->deferred."\n"); fputs($fp, "Deferred: ".$this->deferred."\n");
fputs($fp, "DisableStop: ".$this->nostop."\n");
fputs($fp, "Message:\n".$this->message); fputs($fp, "Message:\n".$this->message);
fclose($fp); fclose($fp);

View File

@ -374,13 +374,12 @@ abstract class CommonDocGenerator
$array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs), $array_key.'_total_localtax1_locale'=>price($object->total_localtax1, 0, $outputlangs),
$array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs), $array_key.'_total_localtax2_locale'=>price($object->total_localtax2, 0, $outputlangs),
$array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs), $array_key.'_total_ttc_locale'=>price($object->total_ttc, 0, $outputlangs),
$array_key.'_total_discount_ht_locale' => price($object->getTotalDiscount(), 0, $outputlangs),
$array_key.'_total_ht'=>price2num($object->total_ht), $array_key.'_total_ht'=>price2num($object->total_ht),
$array_key.'_total_vat'=>(! empty($object->total_vat)?price2num($object->total_vat):price2num($object->total_tva)), $array_key.'_total_vat'=>(! empty($object->total_vat)?price2num($object->total_vat):price2num($object->total_tva)),
$array_key.'_total_localtax1'=>price2num($object->total_localtax1), $array_key.'_total_localtax1'=>price2num($object->total_localtax1),
$array_key.'_total_localtax2'=>price2num($object->total_localtax2), $array_key.'_total_localtax2'=>price2num($object->total_localtax2),
$array_key.'_total_ttc'=>price2num($object->total_ttc), $array_key.'_total_ttc'=>price2num($object->total_ttc),
$array_key.'_total_discount_ht' => price2num($object->getTotalDiscount()),
$array_key.'_multicurrency_code' => price2num($object->multicurrency_code), $array_key.'_multicurrency_code' => price2num($object->multicurrency_code),
$array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx), $array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx),
@ -411,7 +410,17 @@ abstract class CommonDocGenerator
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT') $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT')
); );
if (method_exists($object, 'getTotalDiscount')) {
$resarray[$array_key.'_total_discount_ht_locale'] = price($object->getTotalDiscount(), 0, $outputlangs);
$resarray[$array_key.'_total_discount_ht'] = price2num($object->getTotalDiscount());
} else {
$resarray[$array_key.'_total_discount_ht_locale'] = '';
$resarray[$array_key.'_total_discount_ht'] = '';
}
// Add vat by rates // Add vat by rates
if (is_array($object->lines) && count($object->lines)>0)
{
foreach ($object->lines as $line) foreach ($object->lines as $line)
{ {
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
@ -424,6 +433,7 @@ abstract class CommonDocGenerator
$resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva; $resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]); $resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]);
} }
}
// Retrieve extrafields // Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options)) if (is_array($object->array_options) && count($object->array_options))
{ {

View File

@ -4297,6 +4297,12 @@ abstract class CommonObject
$this->array_options[$key] = null; $this->array_options[$key] = null;
} }
break; break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{
$this->array_options[$key] = null;
}
break;*/
case 'price': case 'price':
$this->array_options[$key] = price2num($this->array_options[$key]); $this->array_options[$key] = price2num($this->array_options[$key]);
break; break;
@ -4430,6 +4436,12 @@ abstract class CommonObject
$this->array_options["options_".$key] = null; $this->array_options["options_".$key] = null;
} }
break; break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{
$this->array_options[$key] = null;
}
break;*/
case 'price': case 'price':
$this->array_options["options_".$key] = price2num($this->array_options["options_".$key]); $this->array_options["options_".$key] = price2num($this->array_options["options_".$key]);
break; break;

View File

@ -570,6 +570,7 @@ class DolGraph
function GetFloorMinValue() function GetFloorMinValue()
{ {
$min = $this->GetMinValueInData(); $min = $this->GetMinValueInData();
if ($min == '') $min=0;
if ($min != 0) $min--; if ($min != 0) $min--;
$size=dol_strlen(abs(floor($min))); $size=dol_strlen(abs(floor($min)));
$factor=1; $factor=1;

View File

@ -882,10 +882,10 @@ class ExtraFields
$out.='<option value="0">&nbsp;</option>'; $out.='<option value="0">&nbsp;</option>';
foreach ($param['options'] as $key => $val) foreach ($param['options'] as $key => $val)
{ {
if ($key == '') continue; if ((string) $key == '') continue;
list($val, $parent) = explode('|', $val); list($val, $parent) = explode('|', $val);
$out.='<option value="'.$key.'"'; $out.='<option value="'.$key.'"';
$out.= ($value==$key?' selected':''); $out.= (((string) $value == (string) $key)?' selected':'');
$out.= (!empty($parent)?' parent="'.$parent.'"':''); $out.= (!empty($parent)?' parent="'.$parent.'"':'');
$out.='>'.$val.'</option>'; $out.='>'.$val.'</option>';
} }

View File

@ -2322,10 +2322,6 @@ class Form
unset($producttmpselect); unset($producttmpselect);
} }
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
}
// mode=2 means suppliers products // mode=2 means suppliers products
$urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; $urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
@ -2333,11 +2329,6 @@ class Form
} }
else else
{ {
if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{
print '<input type="hidden" id="idprod" name="idprod" value="0" />';
print '<script type="text/javascript">$("#'.$htmlname.'").change(function() { $("#idprod").val($(this).val());});</script>';
}
print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice); print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice);
} }
} }
@ -5038,7 +5029,7 @@ class Form
* @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect
* @param array $array Array (key => value) * @param array $array Array (key => value)
* @param string|string[] $id Preselected key or preselected keys for multiselect * @param string|string[] $id Preselected key or preselected keys for multiselect
* @param int $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (value is '' or '&nbsp;' if 1), <0 to add an empty value with key that is this value. * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or '&nbsp;' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
* @param int $key_in_label 1 to show key into label with format "[key] value" * @param int $key_in_label 1 to show key into label with format "[key] value"
* @param int $value_as_key 1 to use value as key * @param int $value_as_key 1 to use value as key
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container

View File

@ -473,7 +473,7 @@ class FormMail extends Form
$out.= ' &lt;'.$this->tomail.'&gt;'; $out.= ' &lt;'.$this->tomail.'&gt;';
if ($this->withtofree) if ($this->withtofree)
{ {
$out.= '<br>'.$langs->trans("or").' <input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />'; $out.= '<br>'.$langs->trans("and").' <input size="'.(is_array($this->withto)?"30":"60").'" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />';
} }
} }
else else
@ -489,7 +489,7 @@ class FormMail extends Form
} }
if (! empty($this->withto) && is_array($this->withto)) if (! empty($this->withto) && is_array($this->withto))
{ {
if (! empty($this->withtofree)) $out.= " ".$langs->trans("or")." "; if (! empty($this->withtofree)) $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withto; $tmparray = $this->withto;
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)
@ -522,7 +522,7 @@ class FormMail extends Form
$out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />'; $out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />';
if (! empty($this->withtocc) && is_array($this->withtocc)) if (! empty($this->withtocc) && is_array($this->withtocc))
{ {
$out.= " ".$langs->trans("or")." "; $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withtocc; $tmparray = $this->withtocc;
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)
@ -551,7 +551,7 @@ class FormMail extends Form
$out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; $out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />';
if (! empty($this->withtoccc) && is_array($this->withtoccc)) if (! empty($this->withtoccc) && is_array($this->withtoccc))
{ {
$out.= " ".$langs->trans("or")." "; $out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withtoccc; $tmparray = $this->withtoccc;
foreach($tmparray as $key => $val) foreach($tmparray as $key => $val)

View File

@ -147,7 +147,7 @@ function limitChars(textarea, limit, infodiv)
{ {
if ($this->withfromreadonly) if ($this->withfromreadonly)
{ {
print '<tr><td class="'.$morecss.'">'.$langs->trans("SmsFrom"); print '<tr><td class="titlefield '.$morecss.'">'.$langs->trans("SmsFrom");
print '<input type="hidden" name="fromsms" value="'.$this->fromsms.'">'; print '<input type="hidden" name="fromsms" value="'.$this->fromsms.'">';
print "</td><td>"; print "</td><td>";
if ($this->fromtype == 'user') if ($this->fromtype == 'user')
@ -223,7 +223,7 @@ function limitChars(textarea, limit, infodiv)
if (is_array($resultsender) && count($resultsender) > 0) if (is_array($resultsender) && count($resultsender) > 0)
{ {
print '<select name="fromsms" id="valid" class="flat">'; print '<select name="fromsms" id="fromsms" class="flat">';
foreach($resultsender as $obj) foreach($resultsender as $obj)
{ {
print '<option value="'.$obj->number.'">'.$obj->number.'</option>'; print '<option value="'.$obj->number.'">'.$obj->number.'</option>';
@ -244,7 +244,7 @@ function limitChars(textarea, limit, infodiv)
// To (target) // To (target)
if ($this->withto || is_array($this->withto)) if ($this->withto || is_array($this->withto))
{ {
print '<tr><td width="180">'; print '<tr><td>';
//$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"); //$moretext=$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients");
$moretext=''; $moretext='';
print $form->textwithpicto($langs->trans("SmsTo"),$moretext); print $form->textwithpicto($langs->trans("SmsTo"),$moretext);
@ -285,7 +285,7 @@ function limitChars(textarea, limit, infodiv)
$defaultmessage=str_replace('\n',"\n",$defaultmessage); $defaultmessage=str_replace('\n',"\n",$defaultmessage);
print "<tr>"; print "<tr>";
print "<td width=\"180\" valign=\"top\">".$langs->trans("SmsText")."</td>"; print '<td class="tdtop">'.$langs->trans("SmsText")."</td>";
print "<td>"; print "<td>";
if ($this->withbodyreadonly) if ($this->withbodyreadonly)
{ {
@ -306,7 +306,7 @@ function limitChars(textarea, limit, infodiv)
<td> <input name="deferred" id="deferred" size="4" value="0"></td></tr> <td> <input name="deferred" id="deferred" size="4" value="0"></td></tr>
<tr><td>'.$langs->trans("Priority").' :</td><td> <tr><td>'.$langs->trans("Priority").' :</td><td>
<select name="priority" id="valid" class="flat"> <select name="priority" id="priority" class="flat">
<option value="0">high</option> <option value="0">high</option>
<option value="1">medium</option> <option value="1">medium</option>
<option value="2" selected>low</option> <option value="2" selected>low</option>
@ -314,11 +314,17 @@ function limitChars(textarea, limit, infodiv)
</select></td></tr> </select></td></tr>
<tr><td>'.$langs->trans("Type").' :</td><td> <tr><td>'.$langs->trans("Type").' :</td><td>
<select name="class" id="valid" class="flat"> <select name="class" id="class" class="flat">
<option value="0">Flash</option> <option value="0">Flash</option>
<option value="1" selected>Standard</option> <option value="1" selected>Standard</option>
<option value="2">SIM</option> <option value="2">SIM</option>
<option value="3">ToolKit</option> <option value="3">ToolKit</option>
</select></td></tr>
<tr><td>'.$langs->trans("DisableStopIfSupported").' :</td><td>
<select name="disablestop" id="disablestop" class="flat">
<option value="0" selected>No</option>
<option value="1" selected>Yes</option>
</select></td></tr>'; </select></td></tr>';
print "</table>\n"; print "</table>\n";

View File

@ -451,7 +451,21 @@ class SMTPs
$this->_setErr(131, 'STARTTLS connection is not supported.'); $this->_setErr(131, 'STARTTLS connection is not supported.');
return $_retVal; return $_retVal;
} }
if (!stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))
// Before 5.6.7:
// STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_SSLv2_CLIENT|STREAM_CRYPTO_METHOD_SSLv3_CLIENT
// STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
// PHP >= 5.6.7:
// STREAM_CRYPTO_METHOD_SSLv23_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT|STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
// STREAM_CRYPTO_METHOD_TLS_CLIENT = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
if (!stream_socket_enable_crypto($this->socket, true, $crypto_method))
{ {
$this->_setErr(132, 'STARTTLS connection failed.'); $this->_setErr(132, 'STARTTLS connection failed.');
return $_retVal; return $_retVal;

View File

@ -40,6 +40,7 @@
* Ex: array('disabled'=> ) * Ex: array('disabled'=> )
* Ex: array('show'=> ) * Ex: array('show'=> )
* Ex: array('update_textarea'=> ) * Ex: array('update_textarea'=> )
* Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
* @return string Script * @return string Script
*/ */
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
@ -146,6 +147,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value $("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
// Disable an element // Disable an element
if (options.option_disabled) { if (options.option_disabled) {
console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled)
if (ui.item.disabled) { if (ui.item.disabled) {
$("#" + options.option_disabled).prop("disabled", true); $("#" + options.option_disabled).prop("disabled", true);
if (options.error) { if (options.error) {
@ -159,23 +161,27 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
} }
} }
if (options.disabled) { if (options.disabled) {
console.log("Make action disabled on each "+options.option_disabled)
$.each(options.disabled, function(key, value) { $.each(options.disabled, function(key, value) {
$("#" + value).prop("disabled", true); $("#" + value).prop("disabled", true);
}); });
} }
if (options.show) { if (options.show) {
console.log("Make action show on each "+options.show)
$.each(options.show, function(key, value) { $.each(options.show, function(key, value) {
$("#" + value).show().trigger("show"); $("#" + value).show().trigger("show");
}); });
} }
// Update an input // Update an input
if (ui.item.update) { if (ui.item.update) {
console.log("Make action update on each ui.item.update")
// loop on each "update" fields // loop on each "update" fields
$.each(ui.item.update, function(key, value) { $.each(ui.item.update, function(key, value) {
$("#" + key).val(value).trigger("change"); $("#" + key).val(value).trigger("change");
}); });
} }
if (ui.item.textarea) { if (ui.item.textarea) {
console.log("Make action textarea on each ui.item.textarea")
$.each(ui.item.textarea, function(key, value) { $.each(ui.item.textarea, function(key, value) {
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") {
CKEDITOR.instances[key].setData(value); CKEDITOR.instances[key].setData(value);
@ -192,7 +198,6 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
} }
,delay: 500 ,delay: 500
}).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) { }).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) {
return $("<li>") return $("<li>")
.data( "'.$dataforitem.'", item ) // jQuery UI > 1.10.0 .data( "'.$dataforitem.'", item ) // jQuery UI > 1.10.0
.append( \'<a><span class="tag">\' + item.label + "</span></a>" ) .append( \'<a><span class="tag">\' + item.label + "</span></a>" )

View File

@ -1043,7 +1043,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
global $param; global $param;
// Check parameters // Check parameters
if (! is_object($filterobj)) dol_print_error('','BadParameter'); if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter');
$out=''; $out='';
$histo=array(); $histo=array();
@ -1061,24 +1061,24 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " a.fk_user_author, a.fk_contact,"; $sql.= " a.fk_user_author, a.fk_contact,";
$sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; $sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,";
$sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname";
if (get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname";
if (get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname"; if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref"; if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
if (get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
if (get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
$sql.= " WHERE u.rowid = a.fk_user_action"; $sql.= " WHERE u.rowid = a.fk_user_action";
$sql.= " AND a.entity IN (".getEntity('agenda').")"; $sql.= " AND a.entity IN (".getEntity('agenda').")";
if (get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
if (get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
if (get_class($filterobj) == 'Adherent') if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
{ {
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
} }
if (get_class($filterobj) == 'CommandeFournisseur') if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
{ {
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'"; $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
@ -1239,7 +1239,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; $out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
if ($objcon && get_class($objcon) == 'Contact' && get_class($filterobj) == 'Societe') if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe')
{ {
$out.='<input type="hidden" name="id" value="'.$objcon->id.'" />'; $out.='<input type="hidden" name="id" value="'.$objcon->id.'" />';
} }
@ -1247,7 +1247,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
{ {
$out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />'; $out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />';
} }
if (get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />'; if ($filterobj && get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
$out.="\n"; $out.="\n";

View File

@ -588,7 +588,7 @@ function dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
} }
/** /**
* Copy a dir to another dir. * Copy a dir to another dir. This include recursive subdirectories.
* *
* @param string $srcfile Source file (a directory) * @param string $srcfile Source file (a directory)
* @param string $destfile Destination file (a directory) * @param string $destfile Destination file (a directory)
@ -630,7 +630,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
$dir_handle=opendir($ossrcfile); $dir_handle=opendir($ossrcfile);
while ($file=readdir($dir_handle)) while ($file=readdir($dir_handle))
{ {
if ($file!="." && $file!="..") if ($file != "." && $file != ".." && ! is_link($ossrcfile."/".$file))
{ {
if (is_dir($ossrcfile."/".$file)) if (is_dir($ossrcfile."/".$file))
{ {
@ -999,7 +999,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
} }
/** /**
* Remove a file or several files with a mask * Remove a file or several files with a mask.
* This delete file physically but also database indexes.
* *
* @param string $file File to delete or mask of files to delete * @param string $file File to delete or mask of files to delete
* @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found * @param int $disableglob Disable usage of glob like * so function is an exact delete function that will return error if no file found
@ -1154,7 +1155,7 @@ function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$
if ($item != "." && $item != "..") if ($item != "." && $item != "..")
{ {
if (is_dir(dol_osencode("$dir/$item"))) if (is_dir(dol_osencode("$dir/$item")) && ! is_link(dol_osencode("$dir/$item")))
{ {
$count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted); $count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted);
} }
@ -1564,12 +1565,14 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=
* @param string $fileinput Input file name * @param string $fileinput Input file name
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $fileoutput Output filename * @param string $fileoutput Output filename
* @return int <0 if KO, >0 if OK * @return int <0 if KO, 0=Nothing done, >0 if OK
*/ */
function dol_convert_file($fileinput,$ext='png',$fileoutput='') function dol_convert_file($fileinput,$ext='png',$fileoutput='')
{ {
global $langs; global $langs;
if (class_exists('Imagick'))
{
$image=new Imagick(); $image=new Imagick();
$ret = $image->readImage($fileinput); $ret = $image->readImage($fileinput);
if ($ret) if ($ret)
@ -1593,6 +1596,11 @@ function dol_convert_file($fileinput,$ext='png',$fileoutput='')
{ {
return -1; return -1;
} }
}
else
{
return 0;
}
} }

View File

@ -192,6 +192,7 @@ function getBrowserInfo($user_agent)
// OS // OS
if (preg_match('/linux/i', $user_agent)) { $os='linux'; } if (preg_match('/linux/i', $user_agent)) { $os='linux'; }
elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; } elseif (preg_match('/macintosh/i', $user_agent)) { $os='macintosh'; }
elseif (preg_match('/windows/i', $user_agent)) { $os='windows'; }
// Name // Name
if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; } if (preg_match('/firefox(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='firefox'; $version=$reg[2]; }
@ -201,7 +202,8 @@ function getBrowserInfo($user_agent)
elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; } elseif (preg_match('/epiphany/i', $user_agent)) { $name='epiphany'; }
elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not. elseif (preg_match('/safari(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not.
elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; } elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $user_agent, $reg)) { $name='opera'; $version=$reg[2]; }
elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/(Windows NT\s([0-9]+\.[0-9])).*(Trident\/[0-9]+.[0-9];.*rv:([0-9]+\.[0-9]+))/i', $user_agent, $reg)) { $name='ie'; $version=end($reg); } // MS products at end
elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; } elseif (preg_match('/l(i|y)n(x|ks)(\(|\/|\s)*([\d\.]+)/i', $user_agent, $reg)) { $name='lynxlinks'; $version=$reg[4]; }
if ($tablet) { if ($tablet) {
@ -1190,10 +1192,10 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$nophoto=''; $nophoto='';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"></div>'; $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"></div>';
} }
elseif ($conf->browser->layout != 'phone') { // Show no photo link //elseif ($conf->browser->layout != 'phone') { // Show no photo link
$nophoto='/public/theme/common/nophoto.png'; $nophoto='/public/theme/common/nophoto.png';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>'; $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.DOL_URL_ROOT.$nophoto.'"></div>';
} //}
} }
} }
else else
@ -1233,10 +1235,13 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file))) if ( (! file_exists($fileimage) || (filemtime($fileimage) < filemtime($file)))
&& (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
) )
{
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
{ {
$ret = dol_convert_file($file, 'png', $fileimage); $ret = dol_convert_file($file, 'png', $fileimage);
if ($ret < 0) $error++; if ($ret < 0) $error++;
} }
}
$heightforphotref=70; $heightforphotref=70;
if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60; if (! empty($conf->dol_optimize_smallscreen)) $heightforphotref=60;
@ -1270,7 +1275,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
} }
} }
if (! $phototoshow && $conf->browser->layout != 'phone') // Show No photo link (picto of pbject) if (! $phototoshow) // Show No photo link (picto of pbject)
{ {
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'; $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">';
if ($object->element == 'action') if ($object->element == 'action')
@ -1286,7 +1291,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub
$nophoto=img_picto('', 'object_'.$picto, '', false, 1); $nophoto=img_picto('', 'object_'.$picto, '', false, 1);
} }
$morehtmlleft.='<!-- No photo to show --><div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.$nophoto.'"></div></div>'; $morehtmlleft.='<!-- No photo to show -->';
$morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$modulepart.($cssclass?' '.$cssclass:'').'" alt="No photo" border="0"'.($width?' width="'.$width.'"':'').' src="'.$nophoto.'"></div></div>';
$morehtmlleft.='</div>'; $morehtmlleft.='</div>';
} }
} }
@ -3695,7 +3702,13 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
$info_bits |= 1; $info_bits |= 1;
} }
$ret=price($rate,0,'',0,0).($addpercent?'%':''); // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price()
if (! preg_match('/\//', $rate)) $ret=price($rate,0,'',0,0).($addpercent?'%':'');
else
{
// TODO Split on / and output with a price2num to have clean numbers with ton of 000.
$ret=$rate.($addpercent?'%':'');
}
if ($info_bits & 1) $ret.=' *'; if ($info_bits & 1) $ret.=' *';
$ret.=$morelabel; $ret.=$morelabel;
return $ret; return $ret;
@ -6260,7 +6273,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
$newres .= $db->escape($tmpcrit2); $newres .= $db->escape($tmpcrit2);
$newres .= $tmpafter; $newres .= $tmpafter;
$newres .= "'"; $newres .= "'";
if (empty($tmpcrit2)) if ($tmpcrit2 == '')
{ {
$newres .= ' OR ' . $field . " IS NULL"; $newres .= ' OR ' . $field . " IS NULL";
} }

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -1470,7 +1470,7 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
*/ */
function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
{ {
global $hookmanager; global $conf, $hookmanager, $mysoc;
$result=''; $result='';
$reshook=0; $reshook=0;
@ -1487,7 +1487,32 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
} }
if (empty($reshook)) if (empty($reshook))
{ {
if (empty($hidedetails) || $hidedetails > 1) $result.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); if (empty($hidedetails) || $hidedetails > 1)
{
$tmpresult='';
$tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1);
if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX))
{
if ($object->lines[$i]->total_localtax1 != 0)
{
if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/';
else $tmpresult='';
$tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1);
}
}
if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX))
{
if ($object->lines[$i]->total_localtax2 != 0)
{
if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/';
else $tmpresult='';
$tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1);
}
}
$result.=$tmpresult;
}
} }
return $result; return $result;
} }

View File

@ -635,12 +635,27 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
print '</td>'; print '</td>';
*/ */
// Project
print "<td>";
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print "</td>";
// Ref // Ref
print '<td>'; print '<td>';
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
print $taskstatic->getNomUrl(1,'withproject'); print $taskstatic->getNomUrl(1,'withproject');
print '</td>'; print '</td>';
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
{
// Thirdparty
print '<td class="tdoverflowmax100">';
$thirdpartystatic->id=$lines[$i]->socid;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
print $thirdpartystatic->getNomUrl(1, 'project', 10);
print '</td>';
}
// Label task // Label task
print "<td>"; print "<td>";
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;"; for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
@ -654,21 +669,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n"; print "</td>\n";
// Project
print "<td>";
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print "</td>";
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
{
// Thirdparty
print '<td class="tdoverflowmax100">';
$thirdpartystatic->id=$lines[$i]->socid;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
print $thirdpartystatic->getNomUrl(1, 'project', 10);
print '</td>';
}
// Planned Workload // Planned Workload
print '<td align="right">'; print '<td align="right">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
@ -745,7 +745,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
// Warning // Warning
print '<td align="right">'; print '<td align="right">';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); else if ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
}
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -834,6 +840,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
$workloadforid[$projectstatic->id]=1; $workloadforid[$projectstatic->id]=1;
} }
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->projectref;
$projectstatic->title=$lines[$i]->projectlabel;
$projectstatic->public=$lines[$i]->public;
$projectstatic->thirdparty_name=$lines[$i]->thirdparty_name;
print '<tr class="oddeven">'."\n"; print '<tr class="oddeven">'."\n";
// User // User
@ -843,6 +855,21 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
print '</td>'; print '</td>';
*/ */
// Project
print '<td class="nowrap">';
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print "</td>";
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
{
// Thirdparty
print '<td class="tdoverflowmax100">';
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
print $thirdpartystatic->getNomUrl(1, 'project');
print '</td>';
}
// Ref // Ref
print '<td class="nowrap">'; print '<td class="nowrap">';
$taskstatic->id=$lines[$i]->id; $taskstatic->id=$lines[$i]->id;
@ -864,26 +891,6 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
print "</td>\n"; print "</td>\n";
// Project
print '<td class="nowrap">';
$projectstatic->id=$lines[$i]->fk_project;
$projectstatic->ref=$lines[$i]->projectref;
$projectstatic->title=$lines[$i]->projectlabel;
$projectstatic->public=$lines[$i]->public;
$projectstatic->thirdparty_name=$lines[$i]->thirdparty_name;
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
print "</td>";
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
{
// Thirdparty
print '<td class="tdoverflowmax100">';
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
print $thirdpartystatic->getNomUrl(1, 'project');
print '</td>';
}
// Planned Workload // Planned Workload
print '<td align="right">'; print '<td align="right">';
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin'); if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
@ -961,7 +968,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
// Warning // Warning
print '<td align="right">'; print '<td align="right">';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $langs->transnoentitiesnoconv("AssignTaskToUser", '...'))); else if ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
print $form->textwithpicto('',$langs->trans("TaskIsNotAssignedToUser", $titleassigntask));
}
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -376,7 +376,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
$check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company) $check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object $checksoc = array('societe'); // Test for societe object
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet','project'); // Test for project object $checkproject = array('projet','project'); // Test for project object
$checktask = array('projet_task'); $checktask = array('projet_task');
$nocheck = array('barcode','stock','fournisseur'); // No test $nocheck = array('barcode','stock','fournisseur'); // No test

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2008-2017 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -201,11 +201,19 @@ function dol_loginfunction($langs,$conf,$mysoc)
$demopassword=$tab[1]; $demopassword=$tab[1];
} }
// Execute hook getLoginPageOptions // Execute hook getLoginPageOptions (for table)
// Should be an array with differents options in $hookmanager->resArray
$parameters=array('entity' => GETPOST('entity','int')); $parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks. resArray is filled by hook. $reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
$morelogincontent = $hookmanager->resArray['options']; // TODO Use here a resprints if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
} else {
$morelogincontent = $hookmanager->resPrint;
}
// Execute hook getLoginPageExtraOptions (eg for js)
$parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageExtraOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
$moreloginextracontent = $hookmanager->resPrint;
// Login // Login
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin)); $login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));

View File

@ -288,16 +288,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Project - Categories -- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&amp;type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&amp;type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&amp;type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&amp;type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
-- Tools -- Tools
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);

View File

@ -357,8 +357,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
$sql = "SELECT rowid, code, label, nature"; $sql = "SELECT rowid, code, label, nature";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
$sql.= " active = 1"; $sql.= " AND active = 1";
$sql.= " ORDER BY label"; $sql.= " ORDER BY label DESC";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com> * Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -953,7 +953,7 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -1035,7 +1035,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
} }

View File

@ -1176,7 +1176,7 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -1270,7 +1270,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
} }

View File

@ -1103,7 +1103,7 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -1186,7 +1186,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
} }

View File

@ -620,7 +620,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -632,7 +632,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
@ -723,7 +723,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);

View File

@ -718,7 +718,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -730,7 +730,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
@ -829,7 +829,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);

View File

@ -941,7 +941,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalVAT").' '; $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate($tvakey,1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);

View File

@ -49,7 +49,7 @@ print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disable
?> ?>
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript"> <script type="text/javascript">
@ -123,7 +123,8 @@ if ($disablenofollow) echo '</a>';
</span> </span>
</td></tr> </td></tr>
<?php <?php
if (! empty($morelogincontent) && is_array($morelogincontent)) { if (! empty($morelogincontent)) {
if (is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option) foreach ($morelogincontent as $format => $option)
{ {
if ($format == 'table') { if ($format == 'table') {
@ -131,10 +132,14 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
echo $option; echo $option;
} }
} }
}
else {
echo '<!-- Option by hook -->';
echo $morelogincontent;
}
} }
?>
<?php if ($captcha) {
if ($captcha) {
// Add a variable param to force not using cache (jmobile) // Add a variable param to force not using cache (jmobile)
$php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time $php_self = preg_replace('/[&\?]time=(\d+)/','',$php_self); // Remove param time
if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog'); if (preg_match('/\?/',$php_self)) $php_self.='&time='.dol_print_date(dol_now(),'dayhourlog');
@ -275,9 +280,9 @@ if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
<!-- Common footer is not used for login page, this is same than footer but inside login tpl --> <!-- Common footer is not used for login page, this is same than footer but inside login tpl -->
<?php if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER; ?>
<?php <?php
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER;
if (! empty($morelogincontent) && is_array($morelogincontent)) { if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option) foreach ($morelogincontent as $format => $option)
{ {
@ -287,9 +292,11 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
} }
} }
} }
?> else if (! empty($moreloginextracontent)) {
echo '<!-- Javascript by hook -->';
echo $moreloginextracontent;
}
<?php
// Google Analytics (need Google module) // Google Analytics (need Google module)
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
{ {
@ -309,9 +316,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)
print '</script>'."\n"; print '</script>'."\n";
} }
} }
?>
<?php
// Google Adsense // Google Adsense
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT)) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{ {

View File

@ -26,7 +26,7 @@
* $langs * $langs
* $dateSelector * $dateSelector
* $forceall (0 by default, 1 for supplier invoices/orders) * $forceall (0 by default, 1 for supplier invoices/orders)
* $senderissupplier (0 by default, 1 for supplier invoices/orders) * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders)
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
*/ */
@ -208,12 +208,13 @@ else {
} }
else else
{ {
// $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum
if ($senderissupplier != 2) if ($senderissupplier != 2)
{ {
$ajaxoptions=array( $ajaxoptions=array(
'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key
'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done
'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo)
); );
$alsoproductwithnosupplierprice=0; $alsoproductwithnosupplierprice=0;
} }
@ -222,6 +223,7 @@ else {
$ajaxoptions = array(); $ajaxoptions = array();
$alsoproductwithnosupplierprice=1; $alsoproductwithnosupplierprice=1;
} }
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice);
} }
echo '</span>'; echo '</span>';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -141,7 +142,16 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
<?php } <?php }
// VAT Rate // VAT Rate
?> ?>
<td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?></td> <td align="right" class="linecolvat nowrap"><?php $coldisplay++; ?><?php
//var_dump($line);
$positiverates='';
if (price2num($line->tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx);
if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx);
if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx);
if (empty($positiverates)) $positiverates='0';
echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits);
//echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
?></td>
<td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td> <td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>

View File

@ -35,7 +35,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword'));
?> ?>
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript"> <script type="text/javascript">
@ -88,14 +88,20 @@ if ($disablenofollow) echo '</a>';
</tr> </tr>
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($morelogincontent)) {
foreach ($hookmanager->resArray['options'] as $format => $option) if (is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{ {
if ($format == 'table') { if ($format == 'table') {
echo '<!-- Option by hook -->'; echo '<!-- Option by hook -->';
echo $option; echo $option;
} }
} }
}
else {
echo '<!-- Option by hook -->';
echo $morelogincontent;
}
} }
?> ?>
@ -175,6 +181,20 @@ if (! empty($hookmanager->resArray['options'])) {
</div> </div>
<?php } ?> <?php } ?>
<?php if (! empty($morelogincontent) && is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'js') {
echo "\n".'<!-- Javascript by hook -->';
echo $option."\n";
}
}
}
else if (! empty($moreloginextracontent)) {
echo '<!-- Javascript by hook -->';
echo $moreloginextracontent;
}
?>
</div> </div>
</div> <!-- end of center --> </div> <!-- end of center -->

View File

@ -74,7 +74,7 @@ $head = cronadmin_prepare_head();
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head,'setup',$langs->trans("Module2300Name"),0,'cron'); dol_fiche_head($head, 'setup', $langs->trans("Module2300Name"), -1, 'cron');
print "<br>\n"; print "<br>\n";

View File

@ -332,10 +332,10 @@ print_liste_field_titre("CronDtStart",$_SERVER["PHP_SELF"],"t.datestart","",$par
print_liste_field_titre("CronDtEnd",$_SERVER["PHP_SELF"],"t.dateend","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("CronDtEnd",$_SERVER["PHP_SELF"],"t.dateend","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("CronMaxRun",$_SERVER["PHP_SELF"],"t.maxrun","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("CronMaxRun",$_SERVER["PHP_SELF"],"t.maxrun","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("CronNbRun",$_SERVER["PHP_SELF"],"t.nbrun","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("CronNbRun",$_SERVER["PHP_SELF"],"t.nbrun","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre("CronDtNextLaunch",$_SERVER["PHP_SELF"],"t.datenextrun","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("CronDtLastLaunch",$_SERVER["PHP_SELF"],"t.datelastrun","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("CronDtLastLaunch",$_SERVER["PHP_SELF"],"t.datelastrun","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("CronLastResult",$_SERVER["PHP_SELF"],"t.lastresult","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("CronLastResult",$_SERVER["PHP_SELF"],"t.lastresult","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("CronLastOutput",$_SERVER["PHP_SELF"],"t.lastoutput","",$param,'',$sortfield,$sortorder); print_liste_field_titre("CronLastOutput",$_SERVER["PHP_SELF"],"t.lastoutput","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("CronDtNextLaunch",$_SERVER["PHP_SELF"],"t.datenextrun","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
@ -424,10 +424,6 @@ if ($num > 0)
if (!empty($obj->nbrun)) {print $obj->nbrun;} else {print '0';} if (!empty($obj->nbrun)) {print $obj->nbrun;} else {print '0';}
print '</td>'; print '</td>';
print '<td class="center">';
if(!empty($obj->datenextrun)) {print dol_print_date($db->jdate($obj->datenextrun),'dayhour');}
print '</td>';
print '<td class="center">'; print '<td class="center">';
if(!empty($obj->datelastrun)) {print dol_print_date($db->jdate($obj->datelastrun),'dayhour');} if(!empty($obj->datelastrun)) {print dol_print_date($db->jdate($obj->datelastrun),'dayhour');}
print '</td>'; print '</td>';
@ -440,6 +436,10 @@ if ($num > 0)
if(!empty($obj->lastoutput)) {print dol_trunc(nl2br($obj->lastoutput),50);} if(!empty($obj->lastoutput)) {print dol_trunc(nl2br($obj->lastoutput),50);}
print '</td>'; print '</td>';
print '<td class="center">';
if(!empty($obj->datenextrun)) {print dol_print_date($db->jdate($obj->datenextrun),'dayhour');}
print '</td>';
// Status // Status
print '<td align="center">'; print '<td align="center">';
if ($obj->status == 1) print $langs->trans("Enabled"); if ($obj->status == 1) print $langs->trans("Enabled");

View File

@ -42,6 +42,8 @@ $typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$value = GETPOST('value'); $value = GETPOST('value');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scan_dir','alpha');
$type='donation'; $type='donation';
@ -287,14 +289,14 @@ if (is_resource($handle))
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
print '</td>'; print '</td>';
} }
} }
else else
{ {
print "<td align=\"center\">\n"; print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>"; print "</td>";
} }
@ -308,7 +310,7 @@ if (is_resource($handle))
else else
{ {
print "<td align=\"center\">"; print "<td align=\"center\">";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '</td>'; print '</td>';
} }

View File

@ -765,7 +765,7 @@ if ($action == 'create')
print "<tr><td>".$langs->trans("DeliveryMethod")."</td>"; print "<tr><td>".$langs->trans("DeliveryMethod")."</td>";
print '<td colspan="3">'; print '<td colspan="3">';
$expe->fetch_delivery_methods(); $expe->fetch_delivery_methods();
print $form->selectarray("shipping_method_id",$expe->meths,GETPOST('shipping_method_id','int'),1,0,0,"",1); print $form->selectarray("shipping_method_id", $expe->meths, GETPOST('shipping_method_id','int'),1,0,0,"",1);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print "</td></tr>\n"; print "</td></tr>\n";
@ -777,11 +777,11 @@ if ($action == 'create')
// Other attributes // Other attributes
$parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid); $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'socid'=>$socid);
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
if (empty($reshook) && ! empty($extrafields->attribute_label)) { if (empty($reshook) && ! empty($extrafields->attribute_label)) {
print $expe->showOptionals($extrafields, 'edit'); print $object->showOptionals($extrafields, 'edit');
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> /* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Cyrille de Lambert <info@auguria.net> * Copyright (C) 2010 Cyrille de Lambert <info@auguria.net>
* *

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com> * Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
@ -1871,7 +1871,7 @@ else
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
$sql.= " WHERE e.rowid = '".$id."'"; $sql.= " WHERE e.rowid = '".$id."'";
$sql.= " AND p.fk_expensereport = e.rowid"; $sql.= " AND p.fk_expensereport = e.rowid";
$sql.= " AND e.entity = ".$conf->entity; $sql.= ' AND e.entity IN ('.getEntity('expensereport').')';
$sql.= " AND p.fk_typepayment = c.id"; $sql.= " AND p.fk_typepayment = c.id";
$sql.= " ORDER BY dp"; $sql.= " ORDER BY dp";
@ -1955,7 +1955,14 @@ else
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' WHERE fde.fk_expensereport = '.$object->id; $sql.= ' WHERE fde.fk_expensereport = '.$object->id;
$sql.= ' ORDER BY fde.date ASC'; if (! empty($conf->global->EXPENSEREPORT_LINES_SORTED_BY_ROWID))
{
$sql.= ' ORDER BY fde.rang ASC, fde.rowid ASC';
}
else
{
$sql.= ' ORDER BY fde.rang ASC, fde.date ASC';
}
print '<div style="clear: both;"></div>'; print '<div style="clear: both;"></div>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -52,6 +52,8 @@ if (! $object->fetch($id, $ref) > 0)
* View * View
*/ */
$form = new Form($db);
llxHeader('',$langs->trans("Intervention")); llxHeader('',$langs->trans("Intervention"));
$object->fetch_thirdparty(); $object->fetch_thirdparty();

View File

@ -31,7 +31,7 @@
*/ */
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0-rc'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (! defined('EURO')) define('EURO',chr(128)); if (! defined('EURO')) define('EURO',chr(128));

View File

@ -66,7 +66,7 @@ $hookmanager->initHooks(array('suppliercard','globalcard'));
* Action * Action
*/ */
$parameters=array('socid'=>$socid); $parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder
// insert products details into database // insert products details into database
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set $result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
@ -1393,7 +1393,7 @@ class CommandeFournisseur extends CommonOrder
if ($fk_product > 0) if ($fk_product > 0)
{ {
if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED))
{ {
// Check quantity is enough // Check quantity is enough
dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref); dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref);
@ -2842,8 +2842,9 @@ class CommandeFournisseur extends CommonOrder
$supplierorderdispatch = new CommandeFournisseurDispatch($this->db); $supplierorderdispatch = new CommandeFournisseurDispatch($this->db);
$filter=array('t.fk_commande'=>$this->id); $filter=array('t.fk_commande'=>$this->id);
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
$filter['t.status']=1; $filter['t.status']=1; // Restrict to lines with status validated
} }
$ret=$supplierorderdispatch->fetchAll('','',0,0,$filter); $ret=$supplierorderdispatch->fetchAll('','',0,0,$filter);
if ($ret<0) if ($ret<0)
{ {
@ -2854,20 +2855,27 @@ class CommandeFournisseur extends CommonOrder
{ {
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0) if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0)
{ {
//Build array with quantity deliverd by product $date_liv = dol_now();
// Build array with quantity deliverd by product
foreach($supplierorderdispatch->lines as $line) { foreach($supplierorderdispatch->lines as $line) {
$qtydelivered[$line->fk_product]+=$line->qty; $qtydelivered[$line->fk_product]+=$line->qty;
} }
foreach($this->lines as $line) { foreach($this->lines as $line) {
$qtywished[$line->fk_product]+=$line->qty; $qtywished[$line->fk_product]+=$line->qty;
} }
$date_liv = dol_now();
//Compare array //Compare array
$diff_array=array_diff_assoc($qtydelivered,$qtywished); $diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys.
$keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys
$keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys
/*var_dump(array_keys($qtydelivered));
var_dump(array_keys($qtywished));
var_dump($diff_array);
var_dump($keysinwishednotindelivered);
var_dump($keysindeliverednotinwished);
exit;*/
if (count($diff_array)==0) //No diff => mean everythings is received if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received
{ {
if ($closeopenorder) if ($closeopenorder)
{ {

View File

@ -588,7 +588,8 @@ class ProductFournisseur extends Product
foreach($record_array as $record) foreach($record_array as $record)
{ {
$fourn_price = $record["price"]; $fourn_price = $record["price"];
$fourn_unitprice = $record["unitprice"]; // discount calculated buy price
$fourn_unitprice = $record["unitprice"] * (1 - $record["remise_percent"] / 100) + $record["unitcharges"] - $record["remise"];
if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) { if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) {
$prod_supplier = new ProductFournisseur($this->db); $prod_supplier = new ProductFournisseur($this->db);
$prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"]; $prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"];
@ -620,7 +621,7 @@ class ProductFournisseur extends Product
$this->fourn_qty = $record["quantity"]; $this->fourn_qty = $record["quantity"];
$this->fourn_remise_percent = $record["remise_percent"]; $this->fourn_remise_percent = $record["remise_percent"];
$this->fourn_remise = $record["remise"]; $this->fourn_remise = $record["remise"];
$this->fourn_unitprice = $fourn_unitprice; $this->fourn_unitprice = $record["unitprice"];
$this->fourn_charges = $record["charges"]; // deprecated $this->fourn_charges = $record["charges"]; // deprecated
$this->fourn_unitcharges = $record["unitcharges"]; // deprecated $this->fourn_unitcharges = $record["unitcharges"]; // deprecated
$this->fourn_tva_tx = $record["tva_tx"]; $this->fourn_tva_tx = $record["tva_tx"];
@ -629,7 +630,7 @@ class ProductFournisseur extends Product
$this->delivery_time_days = $record["delivery_time_days"]; $this->delivery_time_days = $record["delivery_time_days"];
$this->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; $this->fk_supplier_price_expression = $record["fk_supplier_price_expression"];
$this->id = $prodid; $this->id = $prodid;
$min = $this->fourn_unitprice; $min = $fourn_unitprice;
} }
} }
} }

View File

@ -365,21 +365,29 @@ if (empty($reshook))
{ {
$productsupplier = new ProductFournisseur($db); $productsupplier = new ProductFournisseur($db);
if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless
{ {
$idprod=0; $idprod=0;
if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...)
} }
if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg))
if (GETPOST('idprodfournprice') > 0)
{ {
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. $idprod=$reg[1];
$res=$productsupplier->fetch($idprod);
// Call to init properties of $productsupplier
// So if a supplier price already exists for another thirdparty (first one found), we use it as reference price
$productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist
}
elseif (GETPOST('idprodfournprice') > 0)
{
$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat.
//$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist
$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch);
$res=$productsupplier->fetch($idprod);
} }
if ($idprod > 0) if ($idprod > 0)
{ {
$res=$productsupplier->fetch($idprod);
$label = $productsupplier->label; $label = $productsupplier->label;
$desc = $productsupplier->description; $desc = $productsupplier->description;
@ -400,8 +408,8 @@ if (empty($reshook))
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$idprod,
$productsupplier->id, $productsupplier->id,
GETPOST('idprodfournprice'),
$productsupplier->fourn_ref, $productsupplier->fourn_ref,
$remise_percent, $remise_percent,
'HT', 'HT',
@ -2105,6 +2113,7 @@ elseif (! empty($object->id))
// Add free products/services form // Add free products/services form
global $forceall, $senderissupplier, $dateSelector; global $forceall, $senderissupplier, $dateSelector;
$forceall=1; $senderissupplier=1; $dateSelector=0; $forceall=1; $senderissupplier=1; $dateSelector=0;
if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum.
// Show object lines // Show object lines
$inputalsopricewithtax=0; $inputalsopricewithtax=0;

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