Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0
This commit is contained in:
commit
c88f5c560c
43
ChangeLog
43
ChangeLog
@ -9,7 +9,7 @@ NEW: Add a payment module for Stripe.
|
||||
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
||||
NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC)
|
||||
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 "depends on" and "required by" into module informations
|
||||
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 statistics on supplier tab.
|
||||
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: Bookmarks are into a combo list.
|
||||
NEW: Bulk actions available on supplier orders
|
||||
@ -142,13 +142,48 @@ Following changes may create regression for some external modules, but were nece
|
||||
* Removed Societe::set_commnucation_level (was deprecated in 4.0). Was not used.
|
||||
* Removed the trigger file of PAYPAL module that stored data that was not used by Dolibarr. The trigger event still
|
||||
exists, but if an external module need action on it, it must provides itself its trigger file.
|
||||
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode
|
||||
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var
|
||||
$multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into
|
||||
the Home - setup - other admin page.
|
||||
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
||||
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
||||
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
||||
* The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output
|
||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||
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 *****
|
||||
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
|
||||
@ -653,7 +688,7 @@ NEW: Disabled users are striked.
|
||||
NEW: Enhance navigation of project module
|
||||
NEW: fichinter lines ordered by rang AND DATE
|
||||
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: 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.
|
||||
|
||||
@ -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";
|
||||
exit -1;
|
||||
}
|
||||
parse_str($argv[1]);
|
||||
|
||||
$i=0;
|
||||
while ($i < $argc)
|
||||
{
|
||||
@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp)
|
||||
print "\n";
|
||||
|
||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1);
|
||||
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
|
||||
@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
}
|
||||
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; }
|
||||
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
$nboftargetok++;
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
README (English)
|
||||
##################################################
|
||||
Install script for Virtualmin Pro
|
||||
Install script for Virtualmin Professional / GPL
|
||||
##################################################
|
||||
|
||||
This script will install automatically Dolibarr from Virtualmin Pro
|
||||
http://www.virtualmin.com
|
||||
This script will install automatically Dolibarr from Virtualmin.
|
||||
(Included in the professional version and can be added in the GPL version)
|
||||
|
||||
https://www.virtualmin.com
|
||||
http://www.webmin.com/virtualmin.html
|
||||
@ -1,7 +1,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file dolibarr.pl
|
||||
# \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()
|
||||
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
|
||||
@ -177,9 +182,9 @@ if ($opts->{'newdb'} && !$upgrade) {
|
||||
local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2);
|
||||
local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d);
|
||||
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";
|
||||
local $dbhost = &get_database_host($dbtype);
|
||||
local $dbhost = &get_database_host($dbtype, $d);
|
||||
local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass);
|
||||
return (0, "Database connection failed : $dberr") if ($dberr);
|
||||
|
||||
@ -206,9 +211,6 @@ $pgcharset = $tmpl->{'postgres_encoding'};
|
||||
$charset = $dbtype eq "mysql" ? $mycharset : $pgcharset;
|
||||
$collate = $dbtype eq "mysql" ? $mycollate : "C";
|
||||
|
||||
# Install filename
|
||||
local $step = $version >= 3.8 ? "step" : "etape";
|
||||
|
||||
$path = &script_path_url($d, $opts);
|
||||
if ($path =~ /^https:/ || $d->{'ssl'}) {
|
||||
$url = "https://$d->{'dom'}";
|
||||
@ -222,15 +224,11 @@ if ($opts->{'path'} =~ /\w/) {
|
||||
|
||||
if (!$upgrade) {
|
||||
local $cdef = "$opts->{'dir'}/conf/conf.php.example";
|
||||
&run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile));
|
||||
©_source_dest_as_domain_user($d, $cdef, $cfile);
|
||||
&set_permissions_as_domain_user($d, 0777, $cfiledir);
|
||||
&set_permissions_as_domain_user($d, 0666, $cfile);
|
||||
©_source_dest_as_domain_user($d, $cfile);
|
||||
&run_as_domain_user($d, "mkdir ".quotemeta($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 {
|
||||
# Preserve old config file, documents and custom directory
|
||||
@ -266,7 +264,8 @@ if ($upgrade) {
|
||||
[ "versionfrom", $upgrade->{'version'} ],
|
||||
[ "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);
|
||||
|
||||
# Remove the installation directory.
|
||||
@ -289,15 +288,17 @@ else {
|
||||
[ "main_force_https", $opts->{'forcehttps'} ],
|
||||
[ "dolibarr_main_db_character_set", $charset ],
|
||||
[ "dolibarr_main_db_collation", $collate ],
|
||||
[ "main_use_alt_dir", "1" ],
|
||||
[ "usealternaterootdir", "1" ],
|
||||
[ "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);
|
||||
|
||||
# Second page (Populate database)
|
||||
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);
|
||||
|
||||
# Third page (Add administrator account)
|
||||
@ -306,7 +307,8 @@ else {
|
||||
[ "pass", $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);
|
||||
|
||||
# Remove the installation directory and protect config file.
|
||||
@ -384,7 +386,10 @@ sub script_dolibarr_check_latest
|
||||
{
|
||||
local ($ver) = @_;
|
||||
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.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" :
|
||||
|
||||
@ -163,6 +163,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/collab
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
|
||||
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
9419
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -192,6 +192,7 @@ export list="
|
||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
--ignore-table=$base.llx_cabinetmed_cons
|
||||
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||
--ignore-table=$base.llx_cabinetmed_examaut
|
||||
--ignore-table=$base.llx_cabinetmed_exambio
|
||||
@ -207,7 +208,18 @@ export list="
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--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_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_entity
|
||||
--ignore-table=$base.llx_filemanager_roots
|
||||
@ -215,6 +227,8 @@ export list="
|
||||
--ignore-table=$base.llx_google_maps
|
||||
--ignore-table=$base.llx_milestone
|
||||
--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_pos_cash
|
||||
--ignore-table=$base.llx_pos_control_cash
|
||||
|
||||
@ -145,12 +145,12 @@ else if ($action == 'update') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card");
|
||||
$helpurl = "";
|
||||
llxHeader("",$title,$helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("NewFiscalYear"));
|
||||
|
||||
@ -336,17 +336,17 @@ if ($result)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
$fieldtosortaccount="p.accountancy_code_buy";
|
||||
}
|
||||
else $fieldtosortaccount="p.accountancy_code_sell";
|
||||
print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount"));
|
||||
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AssignDedicatedAccountingAccount");
|
||||
$clickpitco=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"');
|
||||
print '</tr>';
|
||||
|
||||
@ -195,11 +195,11 @@ else {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Solde"), $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Solde", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -567,13 +567,13 @@ if ($action == 'create') {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"));
|
||||
print_liste_field_titre($langs->trans("SubledgerAccount"));
|
||||
print_liste_field_titre($langs->trans("Labelcompte"));
|
||||
print_liste_field_titre($langs->trans("Label"));
|
||||
print_liste_field_titre($langs->trans("Debit"), "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre($langs->trans("Credit"), "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre($langs->trans("Action"), "", "", "", "", 'width="60" align="center"');
|
||||
print_liste_field_titre("AccountAccountingShort");
|
||||
print_liste_field_titre("SubledgerAccount");
|
||||
print_liste_field_titre("Labelcompte");
|
||||
print_liste_field_titre("Label");
|
||||
print_liste_field_titre("Debit", "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre("Credit", "", "", "", "", 'align="right"');
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60" align="center"');
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -436,15 +436,15 @@ print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("SubledgerAccount"), $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Docref", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("SubledgerAccount", $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
|
||||
@ -244,14 +244,14 @@ print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF']);
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"));
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']);
|
||||
print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Docref", $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label");
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -201,19 +201,19 @@ print '</div>';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("NumPiece"), $_SERVER['PHP_SELF'], "t.piece_num", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "t.doc_type", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdPartyAccount"), $_SERVER['PHP_SELF'], "t.subledger_account", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "t.montant", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "t.sens", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"), $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("NumPiece", $_SERVER['PHP_SELF'], "t.piece_num", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Doctype", $_SERVER['PHP_SELF'], "t.doc_type", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Docref", $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("ThirdPartyAccount", $_SERVER['PHP_SELF'], "t.subledger_account", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER['PHP_SELF'], "t.montant", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Sens", $_SERVER['PHP_SELF'], "t.sens", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -191,17 +191,17 @@ llxHeader ( '', 'Compta - Grand Livre' );
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td></td>';
|
||||
print_liste_field_titre ( $langs->trans ( "Doctype" ), "liste.php", "bk.doc_type" );
|
||||
print_liste_field_titre ( $langs->trans ( "Docdate" ), "liste.php", "bk.doc_date" );
|
||||
print_liste_field_titre ( $langs->trans ( "Docref" ), "liste.php", "bk.doc_ref" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Numerocompte" ), "liste.php", "bk.numero_compte" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Code_tiers" ), "liste.php", "bk.code_tiers" );
|
||||
print_liste_field_titre ( $langs->trans ( "Labelcompte" ), "liste.php", "bk_label_compte" );
|
||||
print_liste_field_titre ( $langs->trans ( "Debit" ), "liste.php", "bk.debit" );
|
||||
print_liste_field_titre ( $langs->trans ( "Credit" ), "liste.php", "bk.credit" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Amount" ), "liste.php", "bk.montant" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Sens" ), "liste.php", "bk.sens" );
|
||||
print_liste_field_titre ( $langs->trans ( "Codejournal" ), "liste.php", "bk.code_journal" );
|
||||
print_liste_field_titre("Doctype", "liste.php", "bk.doc_type" );
|
||||
print_liste_field_titre("Docdate", "liste.php", "bk.doc_date" );
|
||||
print_liste_field_titre("Docref", "liste.php", "bk.doc_ref" );
|
||||
// print_liste_field_titre("Numerocompte", "liste.php", "bk.numero_compte" );
|
||||
// print_liste_field_titre("Code_tiers", "liste.php", "bk.code_tiers" );
|
||||
print_liste_field_titre("Labelcompte", "liste.php", "bk_label_compte" );
|
||||
print_liste_field_titre("Debit", "liste.php", "bk.debit" );
|
||||
print_liste_field_titre("Credit", "liste.php", "bk.credit" );
|
||||
// print_liste_field_titre("Amount", "liste.php", "bk.montant" );
|
||||
// print_liste_field_titre("Sens", "liste.php", "bk.sens" );
|
||||
print_liste_field_titre("Codejournal", "liste.php", "bk.code_journal" );
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -200,17 +200,17 @@ llxHeader ( '', 'Compta - Grand Livre' );
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td></td>';
|
||||
print_liste_field_titre ( $langs->trans ( "Doctype" ), "liste.php", "bk.doc_type" );
|
||||
print_liste_field_titre ( $langs->trans ( "Docdate" ), "liste.php", "bk.doc_date" );
|
||||
print_liste_field_titre ( $langs->trans ( "Docref" ), "liste.php", "bk.doc_ref" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Numerocompte" ), "liste.php", "bk.numero_compte" );
|
||||
// print_liste_field_titre ( $langs->trans ( "Code_tiers" ), "liste.php", "bk.code_tiers" );
|
||||
print_liste_field_titre ( $langs->trans ( "Labelcompte" ), "liste.php", "bk_label_compte" );
|
||||
print_liste_field_titre ( $langs->trans ( "Debit" ), "liste.php", "bk.debit" );
|
||||
print_liste_field_titre ( $langs->trans ( "Credit" ), "liste.php", "bk.credit" );
|
||||
print_liste_field_titre ( $langs->trans ( "Amount" ), "liste.php", "bk.montant" );
|
||||
print_liste_field_titre ( $langs->trans ( "Sens" ), "liste.php", "bk.sens" );
|
||||
print_liste_field_titre ( $langs->trans ( "Codejournal" ), "liste.php", "bk.code_journal" );
|
||||
print_liste_field_titre("Doctype", "liste.php", "bk.doc_type" );
|
||||
print_liste_field_titre("Docdate", "liste.php", "bk.doc_date" );
|
||||
print_liste_field_titre("Docref", "liste.php", "bk.doc_ref" );
|
||||
// print_liste_field_titre("Numerocompte", "liste.php", "bk.numero_compte" );
|
||||
// print_liste_field_titre("Code_tiers", "liste.php", "bk.code_tiers" );
|
||||
print_liste_field_titre("Labelcompte", "liste.php", "bk_label_compte" );
|
||||
print_liste_field_titre("Debit", "liste.php", "bk.debit" );
|
||||
print_liste_field_titre("Credit", "liste.php", "bk.credit" );
|
||||
print_liste_field_titre("Amount", "liste.php", "bk.montant" );
|
||||
print_liste_field_titre("Sens", "liste.php", "bk.sens" );
|
||||
print_liste_field_titre("Codejournal", "liste.php", "bk.code_journal" );
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -280,17 +280,17 @@ if ($result) {
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef, f.facnumber, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ProductRef"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, fd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
$clickpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -295,16 +295,16 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef, f.facnumber, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ProductRef"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.facnumber, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
|
||||
@ -251,14 +251,14 @@ if ($result) {
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("TypeFees"), $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
|
||||
@ -277,15 +277,15 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("TypeFees"), $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
|
||||
@ -4,7 +4,7 @@ use Stripe\BankAccount;
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -278,18 +278,18 @@ if ($result) {
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("InvoiceLabel"), $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ProductRef"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -294,17 +294,17 @@ if ($result) {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("InvoiceLabel"), $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ProductRef"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Invoice", $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("InvoiceLabel", $_SERVER["PHP_SELF"], "f.libelle", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "f.datef, f.ref, l.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
|
||||
@ -158,6 +158,7 @@ class Adherent extends CommonObject
|
||||
$from=$conf->email_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';
|
||||
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
||||
if ($mailfile->sendfile())
|
||||
|
||||
@ -134,7 +134,7 @@ class AdherentType extends CommonObject
|
||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql.= "vote = '".$this->db->escape($this->vote)."',";
|
||||
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||
$sql .= " WHERE rowid =".$this->id;
|
||||
$sql.= " WHERE rowid =".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
@ -252,7 +252,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
$sql = "SELECT rowid, libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " WHERE entity IN (".getEntity('adherent').")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -594,8 +594,8 @@ if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titr
|
||||
if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'],$_SERVER["PHP_SELF"],'d.address','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'],$_SERVER["PHP_SELF"],'d.zip','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'],$_SERVER["PHP_SELF"],'d.town','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($langs->trans("StateShort"),$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($langs->trans("Country"),$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.town']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'],$_SERVER["PHP_SELF"],'d.phone','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'],$_SERVER["PHP_SELF"],'d.phone_mobile','',$param,'',$sortfield,$sortorder);
|
||||
@ -611,7 +611,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans($company->error);
|
||||
setEventMessages($company->error, $company->errors, 'errors');
|
||||
}
|
||||
else
|
||||
@ -124,7 +123,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
||||
}
|
||||
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"]);
|
||||
}
|
||||
$subscription=$_POST["subscription"]; // Amount of subscription
|
||||
$subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription
|
||||
$label=$_POST["label"];
|
||||
|
||||
// Payment informations
|
||||
@ -230,6 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
if (GETPOST('end') && ! $datesubend)
|
||||
@ -237,6 +237,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
if (! $datesubend)
|
||||
@ -247,16 +248,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$error++;
|
||||
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
|
||||
$amount = price2num(GETPOST("subscription",'alpha'));
|
||||
|
||||
// Check if a payment is mandatory or not
|
||||
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
|
||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action='addsubscription';
|
||||
}
|
||||
@ -274,7 +279,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
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++;
|
||||
$errmsg=$db->lasterror();
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -327,14 +337,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$errmsg=$acct->error;
|
||||
$errmsgs=$acct->errors;
|
||||
}
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errmsg=$acct->error;
|
||||
$errmsgs=$acct->errors;
|
||||
}
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// If option choosed, we create invoice
|
||||
@ -352,6 +364,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -362,6 +375,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$customer->error;
|
||||
$errmsgs=$acct->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -379,6 +393,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$error++;
|
||||
$errmsg='ErrorNoPaymentTermRECEPFound';
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
$invoice->socid=$object->fk_soc;
|
||||
@ -396,6 +411,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
$errmsgs=$invoice->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -416,6 +432,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
if ($result <= 0)
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -428,6 +445,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
$errmsgs=$invoice->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -455,6 +473,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$paiement->error;
|
||||
$errmsgs=$paiement->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -536,6 +555,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
if ($result < 0)
|
||||
{
|
||||
$errmsg=$object->error;
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
|
||||
$title=$langs->trans("ListOfSubscriptions");
|
||||
@ -171,7 +171,7 @@ if ($result)
|
||||
if ($search_acount) $param.="&search_account=".$search_account;
|
||||
if ($search_amount) $param.="&search_amount=".$search_amount;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
@ -181,7 +181,7 @@ if ($result)
|
||||
if ($user->rights->adherent->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
//if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -191,7 +191,7 @@ if ($result)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, '', '', $limit);
|
||||
|
||||
if ($sall)
|
||||
@ -200,11 +200,11 @@ if ($result)
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
@ -237,33 +237,33 @@ if ($result)
|
||||
print '<td align="right" class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'" size="4">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"c.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"c.note",$param,"",'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"b.fk_account",$pram,"","",$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"c.dateadh",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"c.datef",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// Static objects
|
||||
$subscription=new Subscription($db);
|
||||
$adherent=new Adherent($db);
|
||||
@ -286,7 +286,7 @@ if ($result)
|
||||
$adherent->login=$obj->login;
|
||||
$adherent->photo=$obj->photo;
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -329,7 +329,7 @@ if ($result)
|
||||
|
||||
// Price
|
||||
print '<td align="right">'.price($obj->subscription).'</td>';
|
||||
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print "</tr>";
|
||||
@ -338,7 +338,7 @@ if ($result)
|
||||
}
|
||||
|
||||
// Total
|
||||
|
||||
|
||||
print '<tr class="liste_total">';
|
||||
print "<td>".$langs->trans("Total")."</td>\n";
|
||||
print "<td align=\"right\"> </td>\n";
|
||||
|
||||
@ -508,13 +508,13 @@ if ($rowid > 0)
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Nature"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre( $langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Nature",$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("EMail",$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("EndSubscription",$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Action",$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < $num && $i < $conf->liste_limit)
|
||||
|
||||
@ -131,12 +131,11 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
* 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>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@ -67,11 +67,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
$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>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
|
||||
@ -125,11 +125,11 @@ $formother=new FormOther($db);
|
||||
$arrayofjs=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>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -210,7 +210,7 @@ while ($i <= $MAXAGENDA)
|
||||
$color='AGENDA_EXT_COLOR'.$key;
|
||||
$enabled='AGENDA_EXT_ENABLED'.$key;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
|
||||
@ -42,7 +42,7 @@ $action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$param = GETPOST('param','alpha');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'action';
|
||||
|
||||
|
||||
@ -174,12 +174,12 @@ else if ($action == 'setdoc')
|
||||
|
||||
$formactions=new FormActions($db);
|
||||
$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>';
|
||||
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";
|
||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@ -286,7 +286,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -71,11 +71,11 @@ if ($actionsave)
|
||||
|
||||
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>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
@ -43,7 +43,7 @@ if (!$user->admin)
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'bankaccount';
|
||||
|
||||
|
||||
@ -322,7 +322,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($conf->global->BANKADDON_PDF == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&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 . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
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>';
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'order';
|
||||
|
||||
|
||||
@ -464,7 +464,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -476,7 +476,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ $error=0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
||||
|| ($action == 'updateedit') )
|
||||
{
|
||||
$tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0);
|
||||
@ -63,19 +63,19 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["barcode"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("address",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
$varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
|
||||
if ($_FILES[$varforimage]["tmp_name"])
|
||||
{
|
||||
@ -100,8 +100,8 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
if ($isimage > 0)
|
||||
{
|
||||
// Create thumbs
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
// Create small thumb, Used on logon for example
|
||||
$imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
||||
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||
@ -143,27 +143,27 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID5",$_POST["MAIN_INFO_PROFID5"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID6",$_POST["MAIN_INFO_PROFID6"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT",$_POST["object"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START",$_POST["fiscalmonthstart"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("fiscalmonthstart",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
// Local taxes
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", GETPOST("optionlocaltax1",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", GETPOST("optionlocaltax2",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
if($_POST["optionlocaltax1"]=="localtax1on")
|
||||
{
|
||||
@ -173,9 +173,9 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", $_POST["clt1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if($_POST["optionlocaltax2"]=="localtax2on")
|
||||
{
|
||||
@ -185,9 +185,9 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", $_POST["clt2"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if ($action != 'updateedit' && ! $error)
|
||||
@ -207,7 +207,7 @@ if ($action == 'addthumb') // Regenerate thumbs
|
||||
if ($isimage > 0)
|
||||
{
|
||||
// Create thumbs
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
// Create small thumb. Used on logon for example
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality);
|
||||
@ -309,72 +309,72 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
|
||||
// Addresse
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS: GETPOST("address",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:$_POST["zipcode"]) . '"></td></tr>'."\n";
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP: GETPOST("zipcode",'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:$_POST["town"]) . '"></td></tr>'."\n";
|
||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN: GETPOST("town",'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
|
||||
print $form->select_country($mysoc->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="currency">'.$langs->trans("CompanyCurrency").'</label></td><td>';
|
||||
print $form->selectCurrency($conf->currency,"currency");
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_SOCIETE_FAX . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_SOCIETE_MAIL . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_SOCIETE_WEB . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if (! empty($conf->barcode->enabled)) {
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'. $conf->global->MAIN_INFO_SOCIETE_GENCOD . '"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
|
||||
|
||||
print '<tr'.dol_bc($var,'hideonsmartphone').'><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo">';
|
||||
@ -392,9 +392,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '</td></tr>';
|
||||
|
||||
// Note
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '').'</textarea></td></tr>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note','none') ? GETPOST('note','none') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -409,17 +409,17 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
$langs->load("companies");
|
||||
|
||||
// Managing Director(s)
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '"></td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
|
||||
if ($mysoc->country_code) {
|
||||
print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code');
|
||||
@ -431,7 +431,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfID1
|
||||
if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -447,7 +447,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId2
|
||||
if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -463,7 +463,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId3
|
||||
if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -479,7 +479,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId4
|
||||
if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -495,7 +495,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId5
|
||||
if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -511,7 +511,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@ -525,13 +525,13 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
}
|
||||
|
||||
// TVA Intra
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
|
||||
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Object of the company
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="object">'.$langs->trans("CompanyObject").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows="'.ROWS_5.'">'.(! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? $conf->global->MAIN_INFO_SOCIETE_OBJECT : '').'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
@ -546,7 +546,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '</td></tr>';
|
||||
|
||||
@ -561,7 +561,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -570,7 +570,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -593,7 +593,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td>'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
@ -616,7 +616,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -637,7 +637,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
@ -657,7 +657,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -693,22 +693,22 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("CompanyName").'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).'</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCountry").'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
{
|
||||
@ -719,13 +719,13 @@ else
|
||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCurrency").'</td><td>';
|
||||
print currency_name($conf->currency,1);
|
||||
print ' ('.$conf->currency;
|
||||
@ -733,28 +733,28 @@ else
|
||||
print ')';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '</td></tr>';
|
||||
|
||||
// Web
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Logo").'</td><td>';
|
||||
|
||||
$tagtd='tagtd ';
|
||||
@ -780,7 +780,7 @@ else
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -796,17 +796,17 @@ else
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Managing Director(s)
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ManagingDirectors").'</td><td>';
|
||||
print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '</td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Capital").'</td><td>';
|
||||
print $conf->global->MAIN_INFO_CAPITAL . '</td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("JuridicalStatus").'</td><td>';
|
||||
print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
|
||||
print '</td></tr>';
|
||||
@ -814,7 +814,7 @@ else
|
||||
// ProfId1
|
||||
if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId1",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SIREN))
|
||||
{
|
||||
@ -830,7 +830,7 @@ else
|
||||
// ProfId2
|
||||
if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId2",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SIRET))
|
||||
{
|
||||
@ -846,7 +846,7 @@ else
|
||||
// ProfId3
|
||||
if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId3",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_APE))
|
||||
{
|
||||
@ -862,7 +862,7 @@ else
|
||||
// ProfId4
|
||||
if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId4",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_RCS))
|
||||
{
|
||||
@ -878,7 +878,7 @@ else
|
||||
// ProfId5
|
||||
if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId5",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID5))
|
||||
{
|
||||
@ -894,7 +894,7 @@ else
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId6",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID6))
|
||||
{
|
||||
@ -908,7 +908,7 @@ else
|
||||
}
|
||||
|
||||
// VAT
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VATIntra").'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->MAIN_INFO_TVAINTRA))
|
||||
@ -944,8 +944,8 @@ else
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -960,7 +960,7 @@ else
|
||||
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("FiscalMonthStart").'</td><td>';
|
||||
$monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1;
|
||||
print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '</td></tr>';
|
||||
@ -977,7 +977,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -986,7 +986,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -1011,7 +1011,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -1039,7 +1039,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -1061,7 +1061,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@ -1090,7 +1090,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
|
||||
@ -37,7 +37,7 @@ if (!$user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='contract';
|
||||
|
||||
if (empty($conf->global->CONTRACT_ADDON))
|
||||
@ -397,7 +397,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -409,7 +409,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -285,7 +285,7 @@ if ($mode != 'focus')
|
||||
print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
// Entity
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder);
|
||||
// Actions
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -45,7 +45,7 @@ if (! $user->admin)
|
||||
$action=GETPOST('action','alpha');
|
||||
$value=GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='shipping';
|
||||
|
||||
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
||||
@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -440,7 +440,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='expensereport';
|
||||
|
||||
|
||||
@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='ficheinter';
|
||||
|
||||
|
||||
@ -431,7 +431,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@ -439,7 +439,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ if (!$user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='delivery';
|
||||
|
||||
|
||||
@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@ -393,7 +393,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send')
|
||||
}
|
||||
|
||||
$substitutionarrayfortest=array(
|
||||
'__LOGIN__' => $user->login,
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__EMAIL__' => 'TESTEMail',
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
|
||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__ID__' => 'RecipientIdRecord',
|
||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||
'__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"/>':'',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
|
||||
'__LOGIN__' => 'RecipientLogin',
|
||||
'__LASTNAME__' => 'RecipientLastname',
|
||||
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||
'__ADDRESS__'=> 'RecipientAddress',
|
||||
'__ZIP__'=> 'RecipientZip',
|
||||
'__TOWN_'=> 'RecipientTown',
|
||||
'__COUNTRY__'=> 'RecipientCountry'
|
||||
);
|
||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||
|
||||
|
||||
@ -83,27 +83,27 @@ if ($action == 'update')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$menu = new Menubase($db);
|
||||
$result=$menu->fetch($_POST['menuId']);
|
||||
$result=$menu->fetch(GETPOST('menuId', 'int'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$menu->titre=$_POST['titre'];
|
||||
$menu->leftmenu=$_POST['leftmenu'];
|
||||
$menu->url=$_POST['url'];
|
||||
$menu->langs=$_POST['langs'];
|
||||
$menu->position=$_POST['position'];
|
||||
$menu->enabled=$_POST['enabled'];
|
||||
$menu->perms=$_POST['perms'];
|
||||
$menu->target=$_POST['target'];
|
||||
$menu->user=$_POST['user'];
|
||||
if (is_numeric($_POST['menuIdParent']))
|
||||
$menu->titre=GETPOST('titre', 'alpha');
|
||||
$menu->leftmenu=GETPOST('leftmenu', 'alpha');
|
||||
$menu->url=GETPOST('url','alpha');
|
||||
$menu->langs=GETPOST('langs','alpha');
|
||||
$menu->position=GETPOST('position','int');
|
||||
$menu->enabled=GETPOST('enabled','alpha');
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
if (is_numeric(GETPOST('menuIdParent','alpha')))
|
||||
{
|
||||
$menu->fk_menu=$_POST['menuIdParent'];
|
||||
$menu->fk_menu=GETPOST('menuIdParent','alpha');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($_POST['type'] == 'top') $menu->fk_menu=0;
|
||||
if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0;
|
||||
else $menu->fk_menu=-1;
|
||||
$menu->fk_mainmenu=$mainmenu;
|
||||
$menu->fk_leftmenu=$leftmenu;
|
||||
@ -123,7 +123,6 @@ if ($action == 'update')
|
||||
{
|
||||
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||
}
|
||||
$_GET["menuId"] = $_POST['menuId'];
|
||||
$action = "edit";
|
||||
}
|
||||
else
|
||||
@ -148,9 +147,9 @@ if ($action == 'add')
|
||||
}
|
||||
|
||||
$leftmenu=''; $mainmenu='';
|
||||
if (! empty($_POST['menuId']) && ! is_numeric($_POST['menuId']))
|
||||
if (GETPOST('menuId','int') && ! is_numeric(GETPOST('menuId','int')))
|
||||
{
|
||||
$tmp=explode('&',$_POST['menuId']);
|
||||
$tmp=explode('&',GETPOST('menuId','int'));
|
||||
foreach($tmp as $s)
|
||||
{
|
||||
if (preg_match('/fk_mainmenu=/',$s))
|
||||
@ -197,7 +196,7 @@ if ($action == 'add')
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
|
||||
if (! $error && ! $_POST['menuId'] && $_POST['type'] == 'left')
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors');
|
||||
$action = 'create';
|
||||
@ -207,23 +206,23 @@ if ($action == 'add')
|
||||
if (! $error)
|
||||
{
|
||||
$menu = new Menubase($db);
|
||||
$menu->menu_handler=preg_replace('/_menu$/','',$_POST['menu_handler']);
|
||||
$menu->type=$_POST['type'];
|
||||
$menu->titre=$_POST['titre'];
|
||||
$menu->url=$_POST['url'];
|
||||
$menu->langs=$_POST['langs'];
|
||||
$menu->position=$_POST['position'];
|
||||
$menu->enabled=$_POST['enabled'];
|
||||
$menu->perms=$_POST['perms'];
|
||||
$menu->target=$_POST['target'];
|
||||
$menu->user=$_POST['user'];
|
||||
if (is_numeric($_POST['menuId']))
|
||||
$menu->menu_handler=preg_replace('/_menu$/','',GETPOST('menu_handler','aZ09'));
|
||||
$menu->type=GETPOST('type','alpha');
|
||||
$menu->titre=GETPOST('titre','alpha');
|
||||
$menu->url=GETPOST('url','alpha');
|
||||
$menu->langs=GETPOST('langs','alpha');
|
||||
$menu->position=GETPOST('position','int');
|
||||
$menu->enabled=GETPOST('enabled','alpha');
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
if (is_numeric(GETPOST('menuId','int')))
|
||||
{
|
||||
$menu->fk_menu=$_POST['menuId'];
|
||||
$menu->fk_menu=GETPOST('menuId','int');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($_POST['type'] == 'top') $menu->fk_menu=0;
|
||||
if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0;
|
||||
else $menu->fk_menu=-1;
|
||||
$menu->fk_mainmenu=$mainmenu;
|
||||
$menu->fk_leftmenu=$leftmenu;
|
||||
@ -232,7 +231,7 @@ if ($action == 'add')
|
||||
$result=$menu->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$_POST['menu_handler']);
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler','aZ09'));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -305,17 +304,17 @@ if ($action == 'create')
|
||||
</script>';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewMenu"),'','title_setup');
|
||||
|
||||
print '<form action="./edit.php?action=add&menuId='.$_GET['menuId'].'" method="post" name="formmenucreate">';
|
||||
|
||||
print '<form action="./edit.php?action=add&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Id
|
||||
$parent_rowid = $_GET['menuId'];
|
||||
if ($_GET['menuId'])
|
||||
$parent_rowid = GETPOST('menuId', 'int');
|
||||
if (GETPOST('menuId', 'int'))
|
||||
{
|
||||
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
||||
$res = $db->query($sql);
|
||||
@ -375,40 +374,40 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
||||
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int')?GETPOST("menuId", 'int'):'').'"></td>';
|
||||
}
|
||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||
print '</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$_POST["titre"].'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag(GETPOST("titre",'alpha')).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// URL
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.$_POST["url"].'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.GETPOST("url",'alpha').'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$parent_langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.dol_escape_htmltag(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'>'.$langs->trans('').'</option>';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'> </option>';
|
||||
print '<option value="_blank"'.($menu->target=="_blank"?' selected':'').'>'.$langs->trans('_blank').'</option>';
|
||||
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
// Enabled
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.$_POST["enabled"].'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.GETPOST("enabled",'alpha').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
|
||||
// Perms
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.$_POST["perms"].'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.GETPOST('perms','alpha').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Boutons
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
@ -426,14 +425,14 @@ elseif ($action == 'edit')
|
||||
print '<form action="./edit.php?action=update" method="POST" name="formmenuedit">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="handler_origine" value="'.$menu_handler.'">';
|
||||
print '<input type="hidden" name="menuId" value="'.$_GET['menuId'].'">';
|
||||
print '<input type="hidden" name="menuId" value="'.GETPOST('menuId', 'int').'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$menu = new Menubase($db);
|
||||
$result=$menu->fetch($_GET['menuId']);
|
||||
$result=$menu->fetch(GETPOST('menuId', 'int'));
|
||||
//var_dump($menu);
|
||||
|
||||
// Id
|
||||
@ -472,20 +471,20 @@ elseif ($action == 'edit')
|
||||
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$menu->titre.'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$menu->langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.dol_escape_htmltag($menu->langs).'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'>'.$langs->trans('').'</option>';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'> </option>';
|
||||
print '<option value="_blank"'.($menu->target=="_blank"?' selected':'').'>'.$langs->trans('_blank').'</option>';
|
||||
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
@ -502,7 +501,7 @@ elseif ($action == 'edit')
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Bouton
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@ -296,7 +296,7 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
//puis tous les elements enfants
|
||||
|
||||
$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.module";
|
||||
$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.position, m.module";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
$sql.= " WHERE menu_handler = '".$db->escape($menu_handler_to_search)."'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
@ -323,6 +323,7 @@ if ($conf->use_javascript_ajax)
|
||||
'leftmenu'=>$menu['leftmenu'],
|
||||
'fk_mainmenu'=>$menu['fk_mainmenu'],
|
||||
'fk_leftmenu'=>$menu['fk_leftmenu'],
|
||||
'position'=>$menu['position'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
|
||||
'<strong> <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
|
||||
'</td><td align="right">'.
|
||||
@ -344,10 +345,11 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
global $tree_recur_alreadyadded; // This var was def into tree_recur
|
||||
|
||||
// Appelle de la fonction recursive (ammorce)
|
||||
// avec recherche depuis la racine.
|
||||
//var_dump($data);
|
||||
tree_recur($data, $data[0], 0, 'iddivjstree'); // $data[0] is virtual record 'racine'
|
||||
|
||||
// Appelle de la fonction recursive (ammorce) avec recherche depuis la racine.
|
||||
//tree_recur($data, $data[0], 0, 'iddivjstree', 0, 1); // use this to get info on name and foreign keys of menu entry
|
||||
tree_recur($data, $data[0], 0, 'iddivjstree', 0, 0); // $data[0] is virtual record 'racine'
|
||||
|
||||
|
||||
print '</td>';
|
||||
@ -376,7 +378,6 @@ if ($conf->use_javascript_ajax)
|
||||
|
||||
print '<tr>';
|
||||
print '<td colspan="2">';
|
||||
|
||||
foreach($remainingdata as $datar)
|
||||
{
|
||||
$father = array('rowid'=>$datar['rowid'],'title'=>"???",'mainmenu'=>$datar['fk_mainmenu'],'leftmenu'=>$datar['fk_leftmenu'],'fk_mainmenu'=>'','fk_leftmenu'=>'');
|
||||
|
||||
@ -843,115 +843,111 @@ if ($mode == 'marketplace')
|
||||
|
||||
if ($mode == 'deploy')
|
||||
{
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);
|
||||
$allowonlineinstall=true;
|
||||
$allowfromweb=1;
|
||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||
|
||||
$allowonlineinstall=true;
|
||||
$allowfromweb=1;
|
||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||
$fullurl='<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
|
||||
$message='';
|
||||
if (! empty($allowonlineinstall))
|
||||
{
|
||||
if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt)))
|
||||
{
|
||||
$message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$allowfromweb=-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($dirins_ok)
|
||||
{
|
||||
if (! is_writable(dol_osencode($dirins)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock'));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
|
||||
$fullurl='<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
|
||||
$message='';
|
||||
if (! empty($allowonlineinstall))
|
||||
{
|
||||
if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt)))
|
||||
{
|
||||
$message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$allowfromweb=-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($dirins_ok)
|
||||
{
|
||||
if (! is_writable(dol_osencode($dirins)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($allowfromweb < 1)
|
||||
{
|
||||
print $langs->trans("SomethingMakeInstallFromWebNotPossible");
|
||||
print $message;
|
||||
//print $langs->trans("SomethingMakeInstallFromWebNotPossible2");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock'));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
if ($allowfromweb < 1)
|
||||
{
|
||||
print $langs->trans("SomethingMakeInstallFromWebNotPossible");
|
||||
print $message;
|
||||
//print $langs->trans("SomethingMakeInstallFromWebNotPossible2");
|
||||
print '<br>';
|
||||
}
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
}
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='invoice';
|
||||
|
||||
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
|
||||
@ -188,7 +188,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
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>';
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -74,7 +74,11 @@ if ($action == 'update')
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'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_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");
|
||||
exit;
|
||||
}
|
||||
@ -249,6 +253,40 @@ if ($action == 'edit') // Edit
|
||||
|
||||
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
|
||||
print load_fiche_titre($langs->trans("Other"),'','').'<br>';
|
||||
$var=true;
|
||||
@ -444,6 +482,40 @@ else // Show
|
||||
|
||||
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
|
||||
print load_fiche_titre($langs->trans("Other"),'','');
|
||||
$var=true;
|
||||
|
||||
@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='propal';
|
||||
|
||||
/*
|
||||
@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -455,7 +455,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ accessforbidden();
|
||||
$type=GETPOST('type', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
|
||||
$specimenthirdparty=new Societe($db);
|
||||
$specimenthirdparty->initAsSpecimen();
|
||||
@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
||||
//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
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
/*}
|
||||
@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
//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
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ $type=GETPOST('type', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
|
||||
$specimenthirdparty=new Societe($db);
|
||||
$specimenthirdparty->initAsSpecimen();
|
||||
@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">'."\n";
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='supplier_payment';
|
||||
|
||||
|
||||
@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
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>';
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='supplier_proposal';
|
||||
|
||||
$error=0;
|
||||
@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&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.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -260,11 +260,11 @@ if ($result)
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Code"),$_SERVER["PHP_SELF"],"e.type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("IP"),$_SERVER["PHP_SELF"],"e.ip","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.login","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"e.description","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"e.dateevent","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Code",$_SERVER["PHP_SELF"],"e.type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("IP",$_SERVER["PHP_SELF"],"e.ip","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("User",$_SERVER["PHP_SELF"],"u.login","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Description",$_SERVER["PHP_SELF"],"e.description","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -128,12 +128,12 @@ if ($savehandler == 'files')
|
||||
{
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"login","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("SessionId"),$_SERVER["PHP_SELF"],"id","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateModification"),$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Age"),$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Raw"),$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Login",$_SERVER["PHP_SELF"],"login","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("SessionId",$_SERVER["PHP_SELF"],"id","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateModification",$_SERVER["PHP_SELF"],"datem","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Age",$_SERVER["PHP_SELF"],"age","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Raw",$_SERVER["PHP_SELF"],"raw","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -141,7 +141,7 @@ if ($savehandler == 'files')
|
||||
|
||||
foreach ($listofsessions as $key => $sessionentry)
|
||||
{
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -235,10 +235,10 @@ if ($mode == 'overwrite')
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NewTranslationStringToShow"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Key",$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("NewTranslationStringToShow",$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -393,10 +393,10 @@ if ($mode == 'searchkey')
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>';
|
||||
print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CurrentTranslationString"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>';
|
||||
print_liste_field_titre("Key",$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CurrentTranslationString",$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder);
|
||||
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder);
|
||||
print '<td align="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -238,6 +238,7 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
|
||||
{
|
||||
$classfile = str_replace('_', '', $module);
|
||||
if ($module == 'supplierinvoices') $classfile = 'supplier_invoices';
|
||||
if ($module == 'supplierorders') $classfile = 'supplier_orders';
|
||||
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
|
||||
$classname=ucwords($module);
|
||||
|
||||
|
||||
@ -101,19 +101,19 @@ if ($resql)
|
||||
if ($optioncss != '') $param ='&optioncss='.$optioncss;
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
//print "<td> </td>";
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Link"),'','');
|
||||
print_liste_field_titre($langs->trans("Target"),'','','','','align="center"');
|
||||
print_liste_field_titre($langs->trans("Owner"),$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Position"),$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"bid","", $param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"title","", $param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Link",'','');
|
||||
print_liste_field_titre("Target",'','','','','align="center"');
|
||||
print_liste_field_titre("Owner",$_SERVER["PHP_SELF"],"u.lastname","", $param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"b.dateb","", $param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Position",$_SERVER["PHP_SELF"],"b.position","", $param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -122,7 +122,7 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Id
|
||||
@ -209,7 +209,7 @@ if ($resql)
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -38,11 +38,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
@ -580,11 +577,18 @@ 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
|
||||
*/
|
||||
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
@ -710,7 +714,7 @@ if ($action == 'create')
|
||||
// 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
|
||||
@ -786,8 +790,6 @@ if ($action == 'create')
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
// Projet associe
|
||||
$langs->load("projects");
|
||||
|
||||
@ -968,7 +970,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// 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
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent?' checked':'').'></td></tr>';
|
||||
@ -1052,7 +1054,7 @@ if ($id > 0)
|
||||
// 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
|
||||
@ -1133,8 +1135,6 @@ if ($id > 0)
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$formproject=new FormProjets($db);
|
||||
|
||||
$langs->load("projects");
|
||||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>';
|
||||
@ -1217,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>';
|
||||
$linkback.=$out;
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Thirdparty
|
||||
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
@ -1482,7 +1481,7 @@ if ($id > 0)
|
||||
*/
|
||||
|
||||
$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;
|
||||
$delallowed=$user->rights->agenda->myactions->delete;
|
||||
|
||||
@ -1194,7 +1194,7 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
$libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':'');
|
||||
}
|
||||
$result.=$linkstart.img_object(($notooltip?'':$langs->trans("ShowAction").': '.$libelle), ($overwritepicto?$overwritepicto:'action'), ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend;
|
||||
$result.=$linkstart.img_object(($notooltip?'':$langs->trans("ShowAction").': '.$libelle), ($overwritepicto?$overwritepicto:'action'), ($notooltip?'class="valigntextbottom"':'class="classfortooltip valigntextbottom"'), 0, 0, $notooltip?0:1).$linkend;
|
||||
}
|
||||
if ($withpicto==1) $result.=' ';
|
||||
$result.=$linkstart.$libelleshort.$linkend;
|
||||
|
||||
@ -394,17 +394,17 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"a.id",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield,$sortorder);
|
||||
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
||||
if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print_liste_field_titre($langs->trans("LinkedObject"),$_SERVER["PHP_SELF"],"a.fk_element",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateStart",$_SERVER["PHP_SELF"],"a.datep",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateEnd",$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Contact",$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
||||
if (! empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) print_liste_field_titre("LinkedObject",$_SERVER["PHP_SELF"],"a.fk_element",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("ActionsOwnedByShort",$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -30,15 +30,17 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
|
||||
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
|
||||
|
||||
$filter = GETPOST("filter",'',3);
|
||||
$filter = GETPOST("filter",'alpha',3);
|
||||
$filtert = GETPOST("filtert","int",3);
|
||||
$usergroup = GETPOST("usergroup","int",3);
|
||||
//if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
|
||||
@ -55,7 +57,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
@ -82,9 +84,9 @@ $month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
$day=GETPOST("day","int")?GETPOST("day","int"):date("d");
|
||||
$pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
$status=GETPOST("status",'alpha');
|
||||
$type=GETPOST("type",'alpha');
|
||||
$maxprint=((GETPOST("maxprint",'int')!='')?GETPOST("maxprint",'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
@ -93,22 +95,22 @@ if (GETPOST('actioncode','array'))
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode","alpha")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
|
||||
if ($dateselect > 0)
|
||||
{
|
||||
$day=GETPOST('dateselectday');
|
||||
$month=GETPOST('dateselectmonth');
|
||||
$year=GETPOST('dateselectyear');
|
||||
$day=GETPOST('dateselectday','int');
|
||||
$month=GETPOST('dateselectmonth','int');
|
||||
$year=GETPOST('dateselectyear','int');
|
||||
}
|
||||
|
||||
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
|
||||
$tmparray=explode('-',$tmp);
|
||||
$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
|
||||
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
|
||||
$begin_h = GETPOST('begin_h','int')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
|
||||
$end_h = GETPOST('end_h','int')?GETPOST('end_h','int'):($tmparray[1] != '' ? $tmparray[1] : 18);
|
||||
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
|
||||
if ($end_h < 1 || $end_h > 24) $end_h = 18;
|
||||
if ($end_h <= $begin_h) $end_h = $begin_h + 1;
|
||||
@ -124,13 +126,13 @@ if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $ac
|
||||
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
$action='show_month'; $day='';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek') || $action == 'show_week') {
|
||||
if (GETPOST('viewweek','alpha') || $action == 'show_week') {
|
||||
$action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday') || $action == 'show_day') {
|
||||
if (GETPOST('viewday','alpha') || $action == 'show_day') {
|
||||
$action='show_day'; $day=($day?$day:date("d"));
|
||||
} // View by day
|
||||
if (GETPOST('viewyear') || $action == 'show_year') {
|
||||
if (GETPOST('viewyear','alpha') || $action == 'show_year') {
|
||||
$action='show_year';
|
||||
} // View by year
|
||||
|
||||
@ -161,12 +163,12 @@ if ($action =='delete_action')
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$form=new Form($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$now=dol_now();
|
||||
$nowarray=dol_getdate($now);
|
||||
$nowyear=$nowarray['year'];
|
||||
@ -354,7 +356,7 @@ $sql.= ' a.datep2,';
|
||||
$sql.= ' a.percent,';
|
||||
$sql.= ' a.fk_user_author,a.fk_user_action,';
|
||||
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
|
||||
$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,';
|
||||
$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
|
||||
$sql.= ' ca.code, ca.color';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
@ -456,11 +458,14 @@ if ($resql)
|
||||
continue;
|
||||
}
|
||||
|
||||
$datep=$db->jdate($obj->datep);
|
||||
$datep2=$db->jdate($obj->datep2);
|
||||
|
||||
// Create a new object action
|
||||
$event=new ActionComm($db);
|
||||
$event->id=$obj->id;
|
||||
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
|
||||
$event->datef=$db->jdate($obj->datep2);
|
||||
$event->datep=$datep; // datep and datef are GMT date
|
||||
$event->datef=$datep2;
|
||||
$event->type_code=$obj->code;
|
||||
$event->type_color=$obj->color;
|
||||
//$event->libelle=$obj->label; // deprecated
|
||||
@ -469,12 +474,13 @@ if ($resql)
|
||||
//$event->author->id=$obj->fk_user_author; // user id of creator
|
||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||
$event->userownerid=$obj->fk_user_action; // user id of owner
|
||||
$event->fetch_userassigned(); // This load $event->userassigned
|
||||
$event->priority=$obj->priority;
|
||||
$event->fulldayevent=$obj->fulldayevent;
|
||||
$event->location=$obj->location;
|
||||
$event->transparency=$obj->transparency;
|
||||
|
||||
$event->fk_project=$obj->fk_project;
|
||||
|
||||
$event->socid=$obj->fk_soc;
|
||||
$event->contactid=$obj->fk_contact;
|
||||
//$event->societe->id=$obj->fk_soc; // deprecated
|
||||
@ -487,15 +493,15 @@ if ($resql)
|
||||
// They are date start and end of action but modified to not be outside calendar view.
|
||||
if ($event->percentage <= 0)
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
$event->date_start_in_calendar=$datep;
|
||||
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2;
|
||||
else $event->date_end_in_calendar=$datep;
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
{
|
||||
$event->date_start_in_calendar=$datep;
|
||||
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2;
|
||||
else $event->date_end_in_calendar=$datep;
|
||||
}
|
||||
// Define ponctual property
|
||||
if ($event->date_start_in_calendar == $event->date_end_in_calendar)
|
||||
@ -508,10 +514,14 @@ if ($resql)
|
||||
$event->date_start_in_calendar >= $lastdaytoshow)
|
||||
{
|
||||
// This record is out of visible range
|
||||
unset($event);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'<br>'."\n";
|
||||
$event->fetch_userassigned(); // This load $event->userassigned
|
||||
|
||||
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
|
||||
|
||||
// Add an entry in actionarray for each day
|
||||
@ -881,11 +891,37 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases1[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases1[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases1[$h][$event->id]['color']=$color;
|
||||
if ($event->fk_project > 0)
|
||||
{
|
||||
if (empty($cache_project[$event->fk_project]))
|
||||
{
|
||||
$tmpproj=new Project($db);
|
||||
$tmpproj->fetch($event->fk_project);
|
||||
$cache_project[$event->fk_project]=$tmpproj;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title;
|
||||
}
|
||||
if ($event->socid > 0)
|
||||
{
|
||||
if (empty($cache_thirdparty[$event->socid]))
|
||||
{
|
||||
$tmpthirdparty=new Societe($db);
|
||||
$tmpthirdparty->fetch($event->socid);
|
||||
$cache_thirdparty[$event->socid]=$tmpthirdparty;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name;
|
||||
}
|
||||
if ($event->contactid > 0)
|
||||
{
|
||||
if (empty($cache_contact[$event->contactid]))
|
||||
{
|
||||
$tmpcontact=new Contact($db);
|
||||
$tmpcontact->fetch($event->contactid);
|
||||
$cache_contact[$event->contactid]=$tmpcontact;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs);
|
||||
}
|
||||
}
|
||||
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
|
||||
{
|
||||
@ -901,11 +937,37 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases2[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases2[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases2[$h][$event->id]['color']=$color;
|
||||
if ($event->fk_project > 0)
|
||||
{
|
||||
if (empty($cache_project[$event->fk_project]))
|
||||
{
|
||||
$tmpproj=new Project($db);
|
||||
$tmpproj->fetch($event->fk_project);
|
||||
$cache_project[$event->fk_project]=$tmpproj;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title;
|
||||
}
|
||||
if ($event->socid > 0)
|
||||
{
|
||||
if (empty($cache_thirdparty[$event->socid]))
|
||||
{
|
||||
$tmpthirdparty=new Societe($db);
|
||||
$tmpthirdparty->fetch($event->socid);
|
||||
$cache_thirdparty[$event->socid]=$tmpthirdparty;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name;
|
||||
}
|
||||
if ($event->contactid > 0)
|
||||
{
|
||||
if (empty($cache_contact[$event->contactid]))
|
||||
{
|
||||
$tmpcontact=new Contact($db);
|
||||
$tmpcontact->fetch($event->contactid);
|
||||
$cache_contact[$event->contactid]=$tmpcontact;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -928,6 +990,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
||||
}
|
||||
}
|
||||
|
||||
// Now output $casesX
|
||||
for ($h = $begin_h; $h < $end_h; $h++)
|
||||
{
|
||||
$color1='';$color2='';
|
||||
|
||||
@ -30,15 +30,17 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
|
||||
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;
|
||||
|
||||
$filter = GETPOST("filter",'',3);
|
||||
$filter = GETPOST("filter",'alpha',3);
|
||||
$filtert = GETPOST("filtert","int",3);
|
||||
$usergroup = GETPOST("usergroup","int",3);
|
||||
//if (! ($usergroup > 0) && ! ($filtert > 0)) $filtert = $user->id;
|
||||
@ -55,7 +57,7 @@ $sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page","int");
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="a.datec";
|
||||
@ -82,9 +84,9 @@ $month=GETPOST("month","int")?GETPOST("month","int"):date("m");
|
||||
$week=GETPOST("week","int")?GETPOST("week","int"):date("W");
|
||||
$day=GETPOST("day","int")?GETPOST("day","int"):date("d");
|
||||
$pid=GETPOST("projectid","int",3);
|
||||
$status=GETPOST("status");
|
||||
$type=GETPOST("type");
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
$status=GETPOST("status",'alpha');
|
||||
$type=GETPOST("type",'alpha');
|
||||
$maxprint=((GETPOST("maxprint",'int')!='')?GETPOST("maxprint",'int'):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
@ -93,29 +95,30 @@ if (GETPOST('actioncode','array'))
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode","alpha")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
|
||||
|
||||
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int'));
|
||||
if ($dateselect > 0)
|
||||
{
|
||||
$day=GETPOST('dateselectday');
|
||||
$month=GETPOST('dateselectmonth');
|
||||
$year=GETPOST('dateselectyear');
|
||||
$day=GETPOST('dateselectday','int');
|
||||
$month=GETPOST('dateselectmonth','int');
|
||||
$year=GETPOST('dateselectyear','int');
|
||||
}
|
||||
|
||||
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
|
||||
$tmparray=explode('-',$tmp);
|
||||
$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
|
||||
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
|
||||
$begin_h = GETPOST('begin_h','int')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
|
||||
$end_h = GETPOST('end_h','int')?GETPOST('end_h','int'):($tmparray[1] != '' ? $tmparray[1] : 18);
|
||||
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
|
||||
if ($end_h < 1 || $end_h > 24) $end_h = 18;
|
||||
if ($end_h <= $begin_h) $end_h = $begin_h + 1;
|
||||
|
||||
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_DAYS)?'1-5':$conf->global->MAIN_DEFAULT_WORKING_DAYS;
|
||||
$tmparray=explode('-',$tmp);
|
||||
$begin_d = GETPOST('begin_d')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tmparray[0] : 1);
|
||||
$end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5);
|
||||
$begin_d = GETPOST('begin_d','int')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tmparray[0] : 1);
|
||||
$end_d = GETPOST('end_d','int')?GETPOST('end_d','int'):($tmparray[1] != '' ? $tmparray[1] : 5);
|
||||
if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
|
||||
if ($end_d < 1 || $end_d > 7) $end_d = 7;
|
||||
if ($end_d < $begin_d) $end_d = $begin_d + 1;
|
||||
@ -123,13 +126,13 @@ if ($end_d < $begin_d) $end_d = $begin_d + 1;
|
||||
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW);
|
||||
|
||||
if (GETPOST('viewcal') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
if (GETPOST('viewcal','alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||
$action='show_month'; $day='';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek') || $action == 'show_week') {
|
||||
if (GETPOST('viewweek','alpha') || $action == 'show_week') {
|
||||
$action='show_week'; $week=($week?$week:date("W")); $day=($day?$day:date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday') || $action == 'show_day') {
|
||||
if (GETPOST('viewday','alpha') || $action == 'show_day') {
|
||||
$action='show_day'; $day=($day?$day:date("d"));
|
||||
} // View by day
|
||||
|
||||
@ -160,12 +163,12 @@ if ($action =='delete_action')
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$form=new Form($db);
|
||||
$companystatic=new Societe($db);
|
||||
|
||||
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("Agenda"),$help_url);
|
||||
|
||||
$now=dol_now();
|
||||
$nowarray=dol_getdate($now);
|
||||
$nowyear=$nowarray['year'];
|
||||
@ -361,7 +364,7 @@ $sql.= ' a.datep2,';
|
||||
$sql.= ' a.percent,';
|
||||
$sql.= ' a.fk_user_author,a.fk_user_action,';
|
||||
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
|
||||
$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,';
|
||||
$sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
|
||||
$sql.= ' ca.code, ca.color';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
@ -418,14 +421,14 @@ else
|
||||
{
|
||||
// To limit array
|
||||
$sql.= " AND (";
|
||||
$sql.= " (a.datep BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'"; // Start 7 days before
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')"; // End 7 days after + 3 to go from 28 to 31
|
||||
$sql.= " (a.datep BETWEEN '".$db->idate($firstdaytoshow-(60*60*24*2))."'"; // Start 2 day before $firstdaytoshow
|
||||
$sql.= " AND '".$db->idate($lastdaytoshow+(60*60*24*2))."')"; // End 2 day after $lastdaytoshow
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'";
|
||||
$sql.= " AND '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')";
|
||||
$sql.= " (a.datep2 BETWEEN '".$db->idate($firstdaytoshow-(60*60*24*2))."'";
|
||||
$sql.= " AND '".$db->idate($lastdaytoshow+(60*60*24*2))."')";
|
||||
$sql.= " OR ";
|
||||
$sql.= " (a.datep < '".$db->idate(dol_mktime(0,0,0,$month,1,$year)-(60*60*24*7))."'";
|
||||
$sql.= " AND a.datep2 > '".$db->idate(dol_mktime(23,59,59,$month,28,$year)+(60*60*24*10))."')";
|
||||
$sql.= " (a.datep < '".$db->idate($firstdaytoshow-(60*60*24*2))."'";
|
||||
$sql.= " AND a.datep2 > '".$db->idate($lastdaytoshow+(60*60*24*2))."')";
|
||||
$sql.= ')';
|
||||
}
|
||||
if ($type) $sql.= " AND ca.id = ".$type;
|
||||
@ -444,13 +447,14 @@ if ($filtert > 0 || $usergroup > 0)
|
||||
}
|
||||
// Sort on date
|
||||
$sql.= ' ORDER BY fk_user_action, datep'; //fk_user_action
|
||||
//print $sql;
|
||||
//print $sql;exit;
|
||||
|
||||
dol_syslog("comm/action/peruser.php", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -463,11 +467,14 @@ if ($resql)
|
||||
continue;
|
||||
}
|
||||
|
||||
$datep=$db->jdate($obj->datep);
|
||||
$datep2=$db->jdate($obj->datep2);
|
||||
|
||||
// Create a new object action
|
||||
$event=new ActionComm($db);
|
||||
$event->id=$obj->id;
|
||||
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
|
||||
$event->datef=$db->jdate($obj->datep2);
|
||||
$event->datep=$datep; // datep and datef are GMT date
|
||||
$event->datef=$datep2;
|
||||
$event->type_code=$obj->code;
|
||||
$event->type_color=$obj->color;
|
||||
//$event->libelle=$obj->label; // deprecated
|
||||
@ -476,12 +483,13 @@ if ($resql)
|
||||
//$event->author->id=$obj->fk_user_author; // user id of creator
|
||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||
$event->userownerid=$obj->fk_user_action; // user id of owner
|
||||
$event->fetch_userassigned(); // This load $event->userassigned
|
||||
$event->priority=$obj->priority;
|
||||
$event->fulldayevent=$obj->fulldayevent;
|
||||
$event->location=$obj->location;
|
||||
$event->transparency=$obj->transparency;
|
||||
|
||||
$event->fk_project=$obj->fk_project;
|
||||
|
||||
$event->socid=$obj->fk_soc;
|
||||
$event->contactid=$obj->fk_contact;
|
||||
//$event->societe->id=$obj->fk_soc; // deprecated
|
||||
@ -494,15 +502,15 @@ if ($resql)
|
||||
// They are date start and end of action but modified to not be outside calendar view.
|
||||
if ($event->percentage <= 0)
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
$event->date_start_in_calendar=$datep;
|
||||
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2;
|
||||
else $event->date_end_in_calendar=$datep;
|
||||
}
|
||||
else
|
||||
{
|
||||
$event->date_start_in_calendar=$event->datep;
|
||||
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
|
||||
else $event->date_end_in_calendar=$event->datep;
|
||||
$event->date_start_in_calendar=$datep;
|
||||
if ($datep2 != '' && $datep2 >= $datep) $event->date_end_in_calendar=$datep2;
|
||||
else $event->date_end_in_calendar=$datep;
|
||||
}
|
||||
// Define ponctual property
|
||||
if ($event->date_start_in_calendar == $event->date_end_in_calendar)
|
||||
@ -515,10 +523,14 @@ if ($resql)
|
||||
$event->date_start_in_calendar >= $lastdaytoshow)
|
||||
{
|
||||
// This record is out of visible range
|
||||
unset($event);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
//print $i.' - '.dol_print_date($this->date_start_in_calendar, 'dayhour').' - '.dol_print_date($this->date_end_in_calendar, 'dayhour').'<br>'."\n";
|
||||
$event->fetch_userassigned(); // This load $event->userassigned
|
||||
|
||||
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
|
||||
if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
|
||||
|
||||
// Add an entry in actionarray for each day
|
||||
@ -548,6 +560,7 @@ if ($resql)
|
||||
$i++;
|
||||
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -865,11 +878,12 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
global $theme_datacolor; // Array with a list of different we can use (come from theme)
|
||||
global $cachethirdparties, $cachecontacts, $colorindexused;
|
||||
global $begin_h, $end_h;
|
||||
global $cache_project, $cache_thirdparty, $cache_contact;
|
||||
|
||||
$cases1 = array(); // Color first half hour
|
||||
$cases2 = array(); // Color second half hour
|
||||
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year, false, 0);
|
||||
|
||||
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
|
||||
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
|
||||
@ -980,13 +994,39 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
|
||||
else $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=' - '.$event->label;
|
||||
if ($event->label) $cases1[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases1[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases1[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases1[$h][$event->id]['color']=$color;
|
||||
if ($event->fk_project > 0)
|
||||
{
|
||||
if (empty($cache_project[$event->fk_project]))
|
||||
{
|
||||
$tmpproj=new Project($db);
|
||||
$tmpproj->fetch($event->fk_project);
|
||||
$cache_project[$event->fk_project]=$tmpproj;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title;
|
||||
}
|
||||
if ($event->socid > 0)
|
||||
{
|
||||
if (empty($cache_thirdparty[$event->socid]))
|
||||
{
|
||||
$tmpthirdparty=new Societe($db);
|
||||
$tmpthirdparty->fetch($event->socid);
|
||||
$cache_thirdparty[$event->socid]=$tmpthirdparty;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name;
|
||||
}
|
||||
if ($event->contactid > 0)
|
||||
{
|
||||
if (empty($cache_contact[$event->contactid]))
|
||||
{
|
||||
$tmpcontact=new Contact($db);
|
||||
$tmpcontact->fetch($event->contactid);
|
||||
$cache_contact[$event->contactid]=$tmpcontact;
|
||||
}
|
||||
$cases1[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs);
|
||||
}
|
||||
}
|
||||
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
|
||||
{
|
||||
@ -1000,13 +1040,39 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
|
||||
else $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=' - '.$event->label;
|
||||
if ($event->label) $cases2[$h][$event->id]['string'].=' - '.$event->label;
|
||||
$cases2[$h][$event->id]['typecode']=$event->type_code;
|
||||
if ($event->socid)
|
||||
{
|
||||
//$cases2[$h][$event->id]['string'].='xxx';
|
||||
}
|
||||
$cases2[$h][$event->id]['color']=$color;
|
||||
if ($event->fk_project > 0)
|
||||
{
|
||||
if (empty($cache_project[$event->fk_project]))
|
||||
{
|
||||
$tmpproj=new Project($db);
|
||||
$tmpproj->fetch($event->fk_project);
|
||||
$cache_project[$event->fk_project]=$tmpproj;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$langs->trans("Project").': '.$cache_project[$event->fk_project]->ref.' - '.$cache_project[$event->fk_project]->title;
|
||||
}
|
||||
if ($event->socid > 0)
|
||||
{
|
||||
if (empty($cache_thirdparty[$event->socid]))
|
||||
{
|
||||
$tmpthirdparty=new Societe($db);
|
||||
$tmpthirdparty->fetch($event->socid);
|
||||
$cache_thirdparty[$event->socid]=$tmpthirdparty;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$cache_thirdparty[$event->socid]->name;
|
||||
}
|
||||
if ($event->contactid > 0)
|
||||
{
|
||||
if (empty($cache_contact[$event->contactid]))
|
||||
{
|
||||
$tmpcontact=new Contact($db);
|
||||
$tmpcontact->fetch($event->contactid);
|
||||
$cache_contact[$event->contactid]=$tmpcontact;
|
||||
}
|
||||
$cases2[$h][$event->id]['string'].=', '.$cache_contact[$event->contactid]->getFullName($langs);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1029,6 +1095,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
}
|
||||
}
|
||||
|
||||
// Now output $casesX
|
||||
for ($h = $begin_h; $h < $end_h; $h++)
|
||||
{
|
||||
$color1='';$color2='';
|
||||
|
||||
@ -126,14 +126,14 @@ if ($resql)
|
||||
print_barre_liste($title.($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,"",$num);
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?type='.GETPOST("type", "alpha").'" method="GET">';
|
||||
|
||||
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Email"));
|
||||
print_liste_field_titre($langs->trans("Phone"));
|
||||
print_liste_field_titre("Lastname",$_SERVER["PHP_SELF"],"p.name", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Firstname",$_SERVER["PHP_SELF"],"p.firstname", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom", $begin, $param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Email");
|
||||
print_liste_field_titre("Phone");
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -150,7 +150,7 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$obj->cidp.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowContact"),"contact");
|
||||
@ -168,9 +168,9 @@ if ($resql)
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
|
||||
|
||||
$object->substitutionarrayfortest=array(
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__EMAIL__' => 'TESTEMail',
|
||||
//'__EMAIL__' => 'TESTEMail', // Done into "send" action
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname',
|
||||
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
||||
@ -409,6 +409,8 @@ if (empty($reshook))
|
||||
$msgishtml=-1; // Inconnu par defaut
|
||||
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
|
||||
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
||||
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
||||
|
||||
@ -184,12 +184,12 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
$morehtmlright='';
|
||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
|
||||
@ -221,7 +221,7 @@ if ($object->fetch($id) >= 0)
|
||||
print "</div>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
$allowaddtarget=($object->statut == 0);
|
||||
|
||||
@ -232,7 +232,7 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
//print '<table class="noborder" width="100%">';
|
||||
print '<div class="tagtable centpercent liste_titre_bydiv" id="tablelines">';
|
||||
|
||||
|
||||
//print '<tr class="liste_titre">';
|
||||
print '<div class="tagtr liste_titre">';
|
||||
//print '<td class="liste_titre">'.$langs->trans("RecipientSelectionModules").'</td>';
|
||||
@ -245,11 +245,11 @@ if ($object->fetch($id) >= 0)
|
||||
print '<div class="tagtd"> </div>';
|
||||
//print "</tr>\n";
|
||||
print '</div>';
|
||||
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$var = true;
|
||||
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
$modulenames=array();
|
||||
@ -324,7 +324,7 @@ if ($object->fetch($id) >= 0)
|
||||
print $obj->getDesc();
|
||||
//print '</td>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
try {
|
||||
$nbofrecipient=$obj->getNbOfRecipients('');
|
||||
}
|
||||
@ -345,7 +345,7 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
//print '</td>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
//print '<td align="left">';
|
||||
print '<div class="tagtd" align="left">';
|
||||
if ($allowaddtarget)
|
||||
@ -362,7 +362,7 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
//print '</td>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
//print '<td align="right">';
|
||||
print '<div class="tagtd" align="right">';
|
||||
if ($allowaddtarget)
|
||||
@ -377,10 +377,10 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
//print '</td>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
if ($allowaddtarget) print '</form>';
|
||||
else print '</div>';
|
||||
|
||||
|
||||
//print "</tr>\n";
|
||||
// print '</div>'."\n";
|
||||
}
|
||||
@ -389,7 +389,7 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
//print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
}
|
||||
|
||||
@ -412,11 +412,11 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
//$nbtotalofrecords=$object->nbemail; // nbemail is a denormalized field storing nb of targets
|
||||
$sql .= $db->plimit($limit+1, $offset);
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param = "&id=".$object->id;
|
||||
@ -436,7 +436,7 @@ if ($object->fetch($id) >= 0)
|
||||
$cleartext=$langs->trans("ToClearAllRecipientsClickHere").' '.'<a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition">'.$langs->trans("TargetsReset").'</a>';
|
||||
}
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$cleartext,$num,$nbtotalofrecords,'title_generic',0,'','',$limit);
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
print "\n<!-- Liste destinataires selectionnes -->\n";
|
||||
@ -447,12 +447,12 @@ if ($object->fetch($id) >= 0)
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="limit" value="'.$limit.'">';
|
||||
|
||||
|
||||
|
||||
if ($page) $param.= "&page=".$page;
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
|
||||
// Ligne des champs de filtres
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// EMail
|
||||
@ -475,7 +475,7 @@ if ($object->fetch($id) >= 0)
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Date sending
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
@ -490,13 +490,13 @@ if ($object->fetch($id) >= 0)
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("EMail",$_SERVER["PHP_SELF"],"mc.email",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Lastname",$_SERVER["PHP_SELF"],"mc.lastname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Firstname",$_SERVER["PHP_SELF"],"mc.firstname",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("OtherInformations",$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Source",$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
// Date sending
|
||||
if ($object->statut < 2)
|
||||
{
|
||||
@ -504,9 +504,9 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateSending",$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>';
|
||||
|
||||
@ -590,7 +590,7 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($object->statut < 2)
|
||||
if ($object->statut < 2)
|
||||
{
|
||||
print '<tr><td colspan="8" class="opacitymedium">';
|
||||
print $langs->trans("NoTargetYet");
|
||||
|
||||
@ -109,7 +109,7 @@ if ($result)
|
||||
|
||||
$param = "&sall=".urlencode($sall);
|
||||
if ($filteremail) $param.='&filteremail='.urlencode($filteremail);
|
||||
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -117,9 +117,9 @@ if ($result)
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
@ -142,24 +142,24 @@ if ($result)
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
if (! $filteremail) print_liste_field_titre($langs->trans("NbOfEMails"),$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"m.rowid",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Title",$_SERVER["PHP_SELF"],"m.titre",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"m.date_creat",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
if (! $filteremail) print_liste_field_titre("NbOfEMails",$_SERVER["PHP_SELF"],"m.nbemail",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
if (! $filteremail) print_liste_field_titre("DateLastSend",$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
else print_liste_field_titre("DateSending",$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
$email=new Mailing($db);
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
|
||||
print "<tr>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$obj->rowid.'">';
|
||||
|
||||
@ -24,14 +24,14 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
/**
|
||||
* API class for orders
|
||||
*
|
||||
* @access protected
|
||||
* @access protected
|
||||
* @class DolibarrApiAccess {@requires user,external}
|
||||
*/
|
||||
class Proposals extends DolibarrApi
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
*/
|
||||
static $FIELDS = array(
|
||||
'socid'
|
||||
@ -56,36 +56,36 @@ class Proposals extends DolibarrApi
|
||||
* Get properties of a commercial proposal object
|
||||
*
|
||||
* Return an array with commercial proposal informations
|
||||
*
|
||||
*
|
||||
* @param int $id ID of commercial proposal
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function get($id)
|
||||
{
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
$this->propal->fetchObjectLinked();
|
||||
return $this->_cleanObjectDatas($this->propal);
|
||||
}
|
||||
|
||||
/**
|
||||
* List commercial proposals
|
||||
*
|
||||
*
|
||||
* Get a list of commercial proposals
|
||||
*
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
@ -96,12 +96,12 @@ class Proposals extends DolibarrApi
|
||||
*/
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||
@ -109,7 +109,7 @@ class Proposals extends DolibarrApi
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as t";
|
||||
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('propal').')';
|
||||
@ -122,7 +122,7 @@ class Proposals extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
@ -131,7 +131,7 @@ class Proposals extends DolibarrApi
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
@ -144,7 +144,7 @@ class Proposals extends DolibarrApi
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
@ -195,7 +195,7 @@ class Proposals extends DolibarrApi
|
||||
if ($this->propal->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating order", array_merge(array($this->propal->error), $this->propal->errors));
|
||||
}
|
||||
|
||||
|
||||
return $this->propal->id;
|
||||
}
|
||||
|
||||
@ -203,21 +203,21 @@ class Proposals extends DolibarrApi
|
||||
* Get lines of a commercial proposal
|
||||
*
|
||||
* @param int $id Id of commercial proposal
|
||||
*
|
||||
*
|
||||
* @url GET {id}/lines
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getLines($id) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -233,22 +233,22 @@ class Proposals extends DolibarrApi
|
||||
* Add a line to given commercial proposal
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param array $request_data Commercial proposal line data
|
||||
*
|
||||
* @param array $request_data Commercial proposal line data
|
||||
*
|
||||
* @url POST {id}/lines
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -294,22 +294,22 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to update
|
||||
* @param array $request_data Commercial proposal line data
|
||||
*
|
||||
* @param array $request_data Commercial proposal line data
|
||||
*
|
||||
* @url PUT {id}/lines/{lineid}
|
||||
*
|
||||
* @return object
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -352,21 +352,21 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param int $lineid Id of line to delete
|
||||
*
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function delLine($id, $lineid) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -382,20 +382,20 @@ class Proposals extends DolibarrApi
|
||||
* Update commercial proposal general fields (won't touch lines of commercial proposal)
|
||||
*
|
||||
* @param int $id Id of commercial proposal to update
|
||||
* @param array $request_data Datas
|
||||
*
|
||||
* @return int
|
||||
* @param array $request_data Datas
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -403,18 +403,18 @@ class Proposals extends DolibarrApi
|
||||
if ($field == 'id') continue;
|
||||
$this->propal->$field = $value;
|
||||
}
|
||||
|
||||
|
||||
if($this->propal->update($id, DolibarrApiAccess::$user,1,'','','update'))
|
||||
return $this->get($id);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete commercial proposal
|
||||
*
|
||||
* @param int $id Commercial proposal ID
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function delete($id)
|
||||
@ -426,32 +426,32 @@ class Proposals extends DolibarrApi
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
if( ! $this->propal->delete(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500, 'Error when delete Commercial Proposal : '.$this->propal->error);
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Commercial Proposal deleted'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate a commercial proposal
|
||||
*
|
||||
*
|
||||
* @param int $id Commercial proposal ID
|
||||
* @param int $notrigger Use {}
|
||||
*
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
* FIXME An error 403 is returned if the request has an empty body.
|
||||
* Error message: "Forbidden: Content type `text/plain` is not supported."
|
||||
@ -469,11 +469,11 @@ class Proposals extends DolibarrApi
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->propal->valid(DolibarrApiAccess::$user, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(500, 'Error nothing done. May be object is already validated');
|
||||
@ -481,30 +481,30 @@ class Proposals extends DolibarrApi
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating Commercial Proposal: '.$this->propal->error);
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Commercial Proposal validated'
|
||||
'message' => 'Commercial Proposal validated (Ref='.$this->propal->ref.')'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
*
|
||||
* @param array $data Array with data to verify
|
||||
* @return array
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*/
|
||||
function _validate($data)
|
||||
{
|
||||
$propal = array();
|
||||
foreach (Orders::$FIELDS as $field) {
|
||||
foreach (Proposals::$FIELDS as $field) {
|
||||
if (!isset($data[$field]))
|
||||
throw new RestException(400, "$field field missing");
|
||||
$propal[$field] = $data[$field];
|
||||
|
||||
|
||||
}
|
||||
return $propal;
|
||||
}
|
||||
|
||||
@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha');
|
||||
$socid='';
|
||||
if (! empty($user->societe_id))
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result = restrictedArea($user, 'propal', $id);
|
||||
|
||||
@ -73,9 +73,9 @@ $search_zip=GETPOST('search_zip','alpha');
|
||||
$search_state=trim(GETPOST("search_state"));
|
||||
$search_country=GETPOST("search_country",'int');
|
||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
$viewstatut=GETPOST('viewstatut','alpha');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
$object_statut=GETPOST('propal_statut');
|
||||
$object_statut=GETPOST('propal_statut','alpha');
|
||||
|
||||
$sall=GETPOST('sall', 'alphanohtml');
|
||||
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||
@ -734,7 +734,7 @@ if ($resql)
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,8 +80,8 @@ class Orders extends DolibarrApi
|
||||
return $this->_cleanObjectDatas($this->commande);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List orders
|
||||
*
|
||||
@ -101,7 +101,7 @@ class Orders extends DolibarrApi
|
||||
global $db, $conf;
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
|
||||
@ -125,7 +125,7 @@ class Orders extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
@ -134,7 +134,7 @@ class Orders extends DolibarrApi
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
@ -490,7 +490,7 @@ class Orders extends DolibarrApi
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Order validated'
|
||||
'message' => 'Order validated (Ref='.$this->commande->ref.')'
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -502,14 +502,14 @@ class Orders extends DolibarrApi
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
function _cleanObjectDatas($object) {
|
||||
|
||||
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
|
||||
unset($object->address);
|
||||
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
|
||||
@ -120,11 +120,11 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Town",$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("AccountancyCode",$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -146,7 +146,7 @@ if ($resql)
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
@ -155,7 +155,7 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
||||
@ -44,7 +44,6 @@ $ref = GETPOST('ref');
|
||||
// Security check
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'commande',$id,'');
|
||||
|
||||
@ -1036,7 +1036,7 @@ if ($resql)
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -602,12 +602,12 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','','&socid='.$socid,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','','&socid='.$socid,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','','&socid='.$socid, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','','&socid='.$socid, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
|
||||
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
|
||||
print_liste_field_titre('Ref',$_SERVER["PHP_SELF"],'c.ref','','&socid='.$socid,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('RefCustomerOrder',$_SERVER["PHP_SELF"],'c.ref_client','','&socid='.$socid,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre('OrderDate',$_SERVER["PHP_SELF"],'c.date_commande','','&socid='.$socid, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('DeliveryDate',$_SERVER["PHP_SELF"],'c.date_livraison','','&socid='.$socid, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Status','','','','','align="right"');
|
||||
print_liste_field_titre('GenerateBill','','','','','align="center"');
|
||||
print '</tr>';
|
||||
|
||||
// Lignes des champs de filtre
|
||||
|
||||
@ -896,7 +896,7 @@ if ($resql)
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -62,9 +62,7 @@ $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '',
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -122,21 +120,21 @@ if ($id > 0 || !empty($ref)) {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="titlefield">' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
|
||||
print "</table>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
$modulepart = 'bank';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$permtoedit = $user->rights->banque->modifier;
|
||||
|
||||
@ -418,7 +418,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -492,23 +492,36 @@ foreach ($accounts as $key=>$type)
|
||||
// Account number
|
||||
if (! empty($arrayfields['b.account_number']['checked']))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$acc->account_number);
|
||||
|
||||
print '<td>'.length_accountg($accountingaccount->getNomUrl(0,1,1,'',1)).'</td>';
|
||||
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$acc->account_number);
|
||||
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $acc->account_number;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($arrayfields['b.fk_accountancy_journal']['checked']))
|
||||
{
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($acc->fk_accountancy_journal);
|
||||
|
||||
print '<td>'.$accountingjournal->getNomUrl(0,1,1,'',1).'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($acc->fk_accountancy_journal);
|
||||
print $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ if ($action == 'add_confirm')
|
||||
|
||||
if (! $label)
|
||||
{
|
||||
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
|
||||
}
|
||||
if (! $amount)
|
||||
|
||||
@ -275,6 +275,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$refcomp=$societestatic->getNomUrl(1,'',24);
|
||||
|
||||
$paiement = $facturestatic->getSommePaiement(); // Payment already done
|
||||
$paiement+= $facturestatic->getSumDepositsUsed();
|
||||
$paiement+= $facturestatic->getSumCreditNotesUsed();
|
||||
}
|
||||
if ($obj->family == 'social_contribution')
|
||||
{
|
||||
|
||||
@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
$langs->loadLangs(array("compta", "banks", "bills", "users", "accountancy"));
|
||||
|
||||
@ -70,7 +71,7 @@ if (empty($reshook))
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/myobject_list.php',1);
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/compta/bank/various_payment/index.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
@ -172,7 +173,7 @@ if (empty($reshook))
|
||||
if ($result >= 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/salaries/index.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -339,9 +340,9 @@ if ($id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print "<tr>";
|
||||
print "<tr>";
|
||||
print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
print '</td></tr>';
|
||||
@ -349,11 +350,13 @@ if ($id)
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||
|
||||
// Payment date
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("DatePayment").'</td><td>';
|
||||
print dol_print_date($object->datep,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
// Value date
|
||||
print '<tr><td>'.$langs->trans("DateValue").'</td><td>';
|
||||
print dol_print_date($object->datev,'day');
|
||||
print '</td></tr>';
|
||||
@ -370,11 +373,10 @@ if ($id)
|
||||
print '</td><td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountancyaccount = new AccountingAccount($db);
|
||||
$accountancyaccount->fetch('',$object->accountancy_code);
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$object->accountancy_code);
|
||||
|
||||
print $accountancyaccount->getNomUrl(1);
|
||||
// print length_accountg($object->accountancy_code);
|
||||
print $accountingaccount->getNomUrl(1);
|
||||
} else {
|
||||
print $object->accountancy_code;
|
||||
}
|
||||
@ -411,7 +413,7 @@ if ($id)
|
||||
print '<div class="tabsAction">'."\n";
|
||||
if ($object->rappro == 0)
|
||||
{
|
||||
if (! empty($user->rights->banque->delete))
|
||||
if (! empty($user->rights->banque->modifier))
|
||||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/various_payment/index.php
|
||||
* \file htdocs/compta/bank/various_payment/index.php
|
||||
* \ingroup bank
|
||||
* \brief List of various payments
|
||||
*/
|
||||
@ -25,10 +25,10 @@
|
||||
require '../../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("banks");
|
||||
$langs->load("bills");
|
||||
$langs->loadLangs(array("compta","banks","bills","accountancy"));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid","int");
|
||||
@ -41,7 +41,8 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$search_ref = GETPOST('search_ref','int');
|
||||
$search_user = GETPOST('search_user','alpha');
|
||||
$search_label = GETPOST('search_label','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
$search_amount_deb = GETPOST('search_amount_deb','alpha');
|
||||
$search_amount_cred = GETPOST('search_amount_cred','alpha');
|
||||
$search_account = GETPOST('search_account','int');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -75,7 +76,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
$search_amount="";
|
||||
$search_amount_deb="";
|
||||
$search_amount_cred="";
|
||||
$search_account='';
|
||||
$typeid="";
|
||||
}
|
||||
@ -90,8 +92,8 @@ $form = new Form($db);
|
||||
$variousstatic = new PaymentVarious($db);
|
||||
$accountstatic = new Account($db);
|
||||
|
||||
$sql = "SELECT v.rowid, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,";
|
||||
$sql = "SELECT v.rowid, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code, v.sens,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
|
||||
$sql.= " pst.code as payment_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON v.fk_typepayment = pst.id";
|
||||
@ -102,7 +104,8 @@ $sql.= " WHERE v.entity = ".$conf->entity;
|
||||
// Search criteria
|
||||
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
||||
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
||||
if ($search_amount) $sql.=natural_search("v.amount", $search_amount, 1);
|
||||
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
||||
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
|
||||
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||
if ($filtre) {
|
||||
$filtre=str_replace(":","=",$filtre);
|
||||
@ -113,7 +116,6 @@ if ($typeid) {
|
||||
}
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, v.rowid, v.fk_user, v.amount, v.label, v.datev, v.fk_typepayment, v.num_payment, pst.code";
|
||||
$totalnboflines=0;
|
||||
$result=$db->query($sql);
|
||||
if ($result)
|
||||
@ -151,29 +153,35 @@ if ($result)
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("BankAccount"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"),$_SERVER["PHP_SELF"],"v.sens","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
// Ref
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="3" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
|
||||
|
||||
// Date
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
// Type
|
||||
print '<td class="liste_titre" align="left">';
|
||||
$form->select_types_paiements($typeid,'typeid','',0,0,1,16);
|
||||
print '</td>';
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
@ -181,10 +189,15 @@ if ($result)
|
||||
$form->select_comptes($search_account,'search_account',0,'',1);
|
||||
print '</td>';
|
||||
}
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
|
||||
// Sens
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
// Accounting account
|
||||
if (! empty($conf->accounting->enabled)) print '<td class="liste_titre"> </td>';
|
||||
|
||||
// Debit
|
||||
print '<td class="liste_titre" align="right"><input name="search_amount_deb" class="flat" type="text" size="8" value="'.$search_amount_deb.'"></td>';
|
||||
|
||||
// Credit
|
||||
print '<td class="liste_titre" align="right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>';
|
||||
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
@ -193,6 +206,7 @@ if ($result)
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
@ -201,50 +215,81 @@ if ($result)
|
||||
|
||||
$variousstatic->id=$obj->rowid;
|
||||
$variousstatic->ref=$obj->rowid;
|
||||
|
||||
// Ref
|
||||
print "<td>".$variousstatic->getNomUrl(1)."</td>\n";
|
||||
|
||||
// Label payment
|
||||
print "<td>".dol_trunc($obj->label,40)."</td>\n";
|
||||
|
||||
// Date payment
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datep),'day')."</td>\n";
|
||||
|
||||
// Type
|
||||
print '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->fk_bank > 0)
|
||||
{
|
||||
//$accountstatic->fetch($obj->fk_bank);
|
||||
$accountstatic->id=$obj->bid;
|
||||
$accountstatic->ref=$obj->bref;
|
||||
$accountstatic->number=$obj->bnumber;
|
||||
$accountstatic->accountancy_number=$obj->account_number;
|
||||
$accountstatic->fk_accountancy_journal=$obj->fk_accountancy_journal;
|
||||
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
$accountstatic->account_number=$obj->bank_account_number;
|
||||
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($obj->accountancy_journal);
|
||||
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
}
|
||||
|
||||
$accountstatic->label=$obj->blabel;
|
||||
print $accountstatic->getNomUrl(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
// Amount
|
||||
print "<td align=\"right\">".price($obj->amount)."</td>";
|
||||
// Sens
|
||||
if ($obj->sens == '1') $sens = $langs->trans("Credit"); else $sens = $langs->trans("Debit");
|
||||
print "<td align=\"right\">".$sens."</td>";
|
||||
print "<td></td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
// Accounting account
|
||||
if (! empty($conf->accounting->enabled)) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$obj->accountancy_code);
|
||||
|
||||
print '<td>'.$accountingaccount->getNomUrl(0,1,1,'',1).'</td>';
|
||||
}
|
||||
|
||||
// Debit
|
||||
print "<td align=\"right\">";
|
||||
if ($obj->sens == 0)
|
||||
{
|
||||
print price($obj->amount);
|
||||
$totalarray['totaldeb'] += $obj->amount;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Credit
|
||||
print "<td align=\"right\">";
|
||||
if ($obj->sens == 1)
|
||||
{
|
||||
print price($obj->amount);
|
||||
$totalarray['totalcred'] += $obj->amount;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "<td></td>";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$colspan=4;
|
||||
$colspan=5;
|
||||
if (! empty($conf->banque->enabled)) $colspan++;
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="'.$colspan.'" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td class="liste_total" align="right">'.price($total)."</td>";
|
||||
print '<td class="liste_total" align="right">'.price($totalarray['totaldeb'])."</td>";
|
||||
print '<td class="liste_total" align="right">'.price($totalarray['totalcred'])."</td>";
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -92,7 +92,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
if ($mode != 'sconly')
|
||||
if ($mode != 'sconly')
|
||||
{
|
||||
$center=($year?'<a href="index.php?year='.($year-1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="index.php?year='.($year+1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>":"");
|
||||
print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1);
|
||||
@ -120,15 +120,15 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$sql = "SELECT c.id, c.libelle as lib,";
|
||||
@ -278,14 +278,14 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
$total = 0 ;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("ExpectedToPay",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
while ($i < $num)
|
||||
@ -294,7 +294,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'."\n";
|
||||
|
||||
@ -309,12 +309,12 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
|
||||
// Date
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
|
||||
|
||||
|
||||
// Type payment
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
@ -333,7 +333,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// Paid
|
||||
print '<td align="right">'.price($obj->amount)."</td>";
|
||||
print "</tr>\n";
|
||||
@ -411,11 +411,11 @@ while($j<$numlt)
|
||||
$total = 0 ;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
while ($i < $num)
|
||||
@ -424,7 +424,7 @@ while($j<$numlt)
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'."\n";
|
||||
|
||||
@ -465,8 +465,8 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
$sal = new PaymentSalary($db);
|
||||
|
||||
print "<br>";
|
||||
|
||||
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||
|
||||
print_fiche_titre( $langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
|
||||
|
||||
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
|
||||
$sql.= " pct.code as payment_code,";
|
||||
@ -493,13 +493,13 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
$total = 0 ;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("PeriodEndDate",$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("RefPayment",$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("Account",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
$var=1;
|
||||
while ($i < $num)
|
||||
@ -508,7 +508,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
|
||||
$total = $total + $obj->amount;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";
|
||||
@ -527,7 +527,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
print '<td>';
|
||||
if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
print $obj->num_payment.'</td>';
|
||||
|
||||
|
||||
// Account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
@ -546,7 +546,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
// Paid
|
||||
print '<td align="right">'.price($obj->amount)."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
@ -69,7 +69,7 @@ if ($action == 'note')
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($mode == 'search')
|
||||
if ($mode == 'search')
|
||||
{
|
||||
$resql=$db->query($sql);
|
||||
if ($resql) {
|
||||
@ -144,11 +144,11 @@ if ($resql)
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Town",$_SERVER["PHP_SELF"],"s.town","","",'valign="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CustomerCode",$_SERVER["PHP_SELF"],"s.code_client","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("AccountancyCode",$_SERVER["PHP_SELF"],"s.code_compta","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("DateCreation",$_SERVER["PHP_SELF"],"datec",$addu,"",'align="right"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -178,7 +178,7 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
||||
@ -133,12 +133,12 @@ if ($resql)
|
||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Person",$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Company",$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("FeesKilometersOrAmout",$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -178,7 +178,7 @@ if ($resql)
|
||||
$soc = new Societe($db);
|
||||
if ($obj->socid) $soc->fetch($obj->socid);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Id
|
||||
print '<td><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowTrip"),"trip").' '.$obj->rowid.'</a></td>';
|
||||
|
||||
@ -648,12 +648,13 @@ if (empty($reshook))
|
||||
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
|
||||
|
||||
$sql = 'SELECT SUM(pf.amount) as total_paiements
|
||||
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);
|
||||
if (! $resql) dol_print_error($db);
|
||||
|
||||
$res = $db->fetch_object($resql);
|
||||
$total_paiements = $res->total_paiements;
|
||||
|
||||
@ -4103,11 +4104,11 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ($objectidnext) {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
} else {
|
||||
if ($resteapayer == 0) {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
} else {
|
||||
//if ($resteapayer == 0) {
|
||||
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
//} else {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&action=create&accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,14 +22,14 @@
|
||||
/**
|
||||
* API class for invoices
|
||||
*
|
||||
* @access protected
|
||||
* @access protected
|
||||
* @class DolibarrApiAccess {@requires user,external}
|
||||
*/
|
||||
class Invoices extends DolibarrApi
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
*/
|
||||
static $FIELDS = array(
|
||||
'socid'
|
||||
@ -54,23 +54,23 @@ class Invoices extends DolibarrApi
|
||||
* Get properties of a invoice object
|
||||
*
|
||||
* Return an array with invoice informations
|
||||
*
|
||||
*
|
||||
* @param int $id ID of invoice
|
||||
* @return array|mixed data without useless information
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function get($id)
|
||||
{
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -80,9 +80,9 @@ class Invoices extends DolibarrApi
|
||||
|
||||
/**
|
||||
* List invoices
|
||||
*
|
||||
*
|
||||
* Get a list of invoices
|
||||
*
|
||||
*
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
@ -96,12 +96,12 @@ class Invoices extends DolibarrApi
|
||||
*/
|
||||
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') {
|
||||
global $db, $conf;
|
||||
|
||||
|
||||
$obj_ret = array();
|
||||
|
||||
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||
|
||||
|
||||
// If the internal user must only see his customers, force searching by him
|
||||
$search_sale = 0;
|
||||
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||
@ -109,7 +109,7 @@ class Invoices extends DolibarrApi
|
||||
$sql = "SELECT t.rowid";
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as t";
|
||||
|
||||
|
||||
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||
|
||||
$sql.= ' WHERE t.entity IN ('.getEntity('facture').')';
|
||||
@ -117,7 +117,7 @@ class Invoices extends DolibarrApi
|
||||
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||
|
||||
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||
|
||||
|
||||
// Filter by status
|
||||
if ($status == 'draft') $sql.= " AND t.fk_statut IN (0)";
|
||||
if ($status == 'unpaid') $sql.= " AND t.fk_statut IN (1)";
|
||||
@ -129,7 +129,7 @@ class Invoices extends DolibarrApi
|
||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters)
|
||||
if ($sqlfilters)
|
||||
{
|
||||
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||
{
|
||||
@ -138,7 +138,7 @@ class Invoices extends DolibarrApi
|
||||
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||
}
|
||||
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
@ -174,10 +174,10 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
return $obj_ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create invoice object
|
||||
*
|
||||
*
|
||||
* @param array $request_data Request datas
|
||||
* @return int ID of invoice
|
||||
*/
|
||||
@ -188,7 +188,7 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
// Check mandatory fields
|
||||
$result = $this->_validate($request_data);
|
||||
|
||||
|
||||
foreach($request_data as $field => $value) {
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
@ -203,7 +203,7 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
$this->invoice->lines = $lines;
|
||||
}*/
|
||||
|
||||
|
||||
if ($this->invoice->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating invoice", array_merge(array($this->invoice->error), $this->invoice->errors));
|
||||
}
|
||||
@ -214,20 +214,20 @@ class Invoices extends DolibarrApi
|
||||
* Update invoice
|
||||
*
|
||||
* @param int $id Id of invoice to update
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*/
|
||||
function put($id, $request_data = NULL)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
@ -236,13 +236,13 @@ class Invoices extends DolibarrApi
|
||||
if ($field == 'id') continue;
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
|
||||
|
||||
if($this->invoice->update($id, DolibarrApiAccess::$user))
|
||||
return $this->get ($id);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete invoice
|
||||
*
|
||||
@ -258,16 +258,16 @@ class Invoices extends DolibarrApi
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
if( $this->invoice->delete($id) < 0)
|
||||
{
|
||||
throw new RestException(500);
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
@ -275,13 +275,76 @@ class Invoices extends DolibarrApi
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate an order
|
||||
*
|
||||
* @param int $id Order ID
|
||||
* @param int $idwarehouse Warehouse ID
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
*
|
||||
* @url POST {id}/validate
|
||||
*
|
||||
* @return array
|
||||
* FIXME An error 403 is returned if the request has an empty body.
|
||||
* Error message: "Forbidden: Content type `text/plain` is not supported."
|
||||
* Workaround: send this in the body
|
||||
* {
|
||||
* "idwarehouse": 0,
|
||||
* "notrigger": 0
|
||||
* }
|
||||
*/
|
||||
function validate($id, $idwarehouse=0, $notrigger=0)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger);
|
||||
if ($result == 0) {
|
||||
throw new RestException(500, 'Error nothing done. May be object is already validated');
|
||||
}
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Invoice validated (Ref='.$this->invoice->ref.')'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
function _cleanObjectDatas($object) {
|
||||
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->address);
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate fields before create or update object
|
||||
*
|
||||
*
|
||||
* @param array|null $data Datas to validate
|
||||
* @return array
|
||||
*
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
function _validate($data)
|
||||
@ -294,5 +357,5 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
return $invoice;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -748,6 +748,15 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Charge facture source
|
||||
$facture=new Facture($this->db);
|
||||
|
||||
$this->fetch_optionals();
|
||||
if(!empty($this->array_options)){
|
||||
$facture->array_options = $this->array_options;
|
||||
}
|
||||
|
||||
foreach($this->lines as &$line){
|
||||
$line->fetch_optionals();//fetch extrafields
|
||||
}
|
||||
|
||||
$facture->fk_facture_source = $this->fk_facture_source;
|
||||
$facture->type = $this->type;
|
||||
@ -774,7 +783,7 @@ class Facture extends CommonInvoice
|
||||
$facture->situation_final = $this->situation_final;
|
||||
|
||||
// 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;
|
||||
if ($invertdetail)
|
||||
|
||||
@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha');
|
||||
// Security check
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'facture',$id,'');
|
||||
@ -72,9 +71,11 @@ if ($object->fetch($id))
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
|
||||
|
||||
@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref))
|
||||
dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref))
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Invoice content
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
|
||||
@ -39,6 +39,8 @@ $ref=GETPOST("ref",'alpha');
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -979,7 +979,7 @@ if ($resql)
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
$sortonfield = "ef.".$key;
|
||||
if (! empty($extrafields->attribute_computed[$key])) $sortonfield='';
|
||||
print_liste_field_titre($langs->trans($extralabels[$key]),$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],$sortonfield,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -854,10 +854,10 @@ if (! GETPOST('action','aZ09'))
|
||||
print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Invoice',$_SERVER["PHP_SELF"],'facnumber','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Date',$_SERVER["PHP_SELF"],'dp','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Type',$_SERVER["PHP_SELF"],'libelle','','','',$sortfield,$sortorder);
|
||||
print_liste_field_titre('Amount',$_SERVER["PHP_SELF"],'fa_amount','','','align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -101,17 +101,17 @@ if ($resql)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.rowid","","",'width="60"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"p.rowid","","",'width="60"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"dp","","",'width="80" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Type",$_SERVER["PHP_SELF"],"c.libelle","","","",$sortfield,$sortorder);
|
||||
print_liste_field_titre("AmountTTC",$_SERVER["PHP_SELF"],"c.libelle","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>';
|
||||
print '<td width="80" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user