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

This commit is contained in:
Florian HENRY 2015-07-20 08:32:07 +02:00
commit 0394c9d594
1064 changed files with 39795 additions and 30437 deletions

View File

@ -21,9 +21,9 @@ Florian Henry <florian.henry@open-concept.pro> FHenry <florian.henry.mail@gmail.
Florian Henry <florian.henry@open-concept.pro> Florian HENRY <florian.henry@open-conept.pro> Florian Henry <florian.henry@open-concept.pro> Florian HENRY <florian.henry@open-conept.pro>
Florian Henry <florian.henry@open-concept.pro> FHenry <florian.henry@open-concept.pro> Florian Henry <florian.henry@open-concept.pro> FHenry <florian.henry@open-concept.pro>
Florian Henry <florian.henry@open-concept.pro> HENRY Florian <florian.henry@open-concept.pro> Florian Henry <florian.henry@open-concept.pro> HENRY Florian <florian.henry@open-concept.pro>
Alexandre Spangaro <alexandre.spangaro@gmail.com> aspangaro <alexandre.spangaro@gmail.com> Alexandre Spangaro <aspangaro.dolibarr@gmail.com> aspangaro <aspangaro.dolibarr@gmail.com>
Alexandre Spangaro <alexandre.spangaro@gmail.com> Spangaro Alexandre <alexandre.spangaro@gmail.com> Alexandre Spangaro <aspangaro.dolibarr@gmail.com> Spangaro Alexandre <aspangaro.dolibarr@gmail.com>
Alexandre Spangaro <alexandre.spangaro@gmail.com> Alexandre SPANGARO <alexandre.spangaro@gmail.com> Alexandre Spangaro <aspangaro.dolibarr@gmail.com> Alexandre SPANGARO <aspangaro.dolibarr@gmail.com>
Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> Raphaël Doursenaud <rdoursenaud@free.fr> Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> Raphaël Doursenaud <rdoursenaud@free.fr>
Philippe Grand <philippe.grand@atoo-net.com> Grand Philippe <contact@atoo-net.com> Philippe Grand <philippe.grand@atoo-net.com> Grand Philippe <contact@atoo-net.com>
Philippe Grand <philippe.grand@atoo-net.com> Philippe GRAND <philippe.grand@atoo-net.com> Philippe Grand <philippe.grand@atoo-net.com> Philippe GRAND <philippe.grand@atoo-net.com>

View File

@ -1,6 +1,6 @@
[main] [main]
host = https://www.transifex.com host = https://www.transifex.com
lang_map = uz: uz_UZ, sw: sw_SW lang_map = uz: uz_UZ, sw: sw_SW, sr@latin: sr_RS
[dolibarr.accountancy] [dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang file_filter = htdocs/langs/<lang>/accountancy.lang

View File

@ -42,13 +42,13 @@ jQuery jNotify 1.1.00 Apache Software License 2.0 Yes
jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors
jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors
jQuery Layout 1.4.3 GPL and MIT License Yes JS library plugin Layout (RC-29.15) jQuery Layout 1.4.3 GPL and MIT License Yes JS library plugin Layout
jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used) jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used)
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
jsGantt 1.2 BSD License Yes JS library (to build Gantt reports) jsGantt 1.2 BSD License Yes JS library (to build Gantt reports)
JsTimezoneDetect 1.0.4 MIT Licence Yes JS library to detect user timezone JsTimezoneDetect 1.0.4 MIT Licence Yes JS library to detect user timezone
For licenses compatibility informations: For licenses compatibility informations:
http://www.fsf.org/licensing/licenses/index_html http://www.fsf.org/licensing/licenses/index_html
@ -60,7 +60,7 @@ Copyright
Copyright (C) 2015 Copyright (C) 2015
- Laurent Destailleur <eldy@users.sourceforge.net> - Laurent Destailleur <eldy@users.sourceforge.net>
- Marcos García <marcosgdf@gmail.com> - Marcos García <marcosgdf@gmail.com>
- Alexandre Spangaro <alexandre.spangaro@gmail.com> - Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
- Frederic France <frederic.france@free.fr> - Frederic France <frederic.france@free.fr>
- Regis Houssin <regis.houssin@capnetworks.com> - Regis Houssin <regis.houssin@capnetworks.com>
@ -74,7 +74,7 @@ Copyright (C) 2014
- Regis Houssin <regis.houssin@capnetworks.com> - Regis Houssin <regis.houssin@capnetworks.com>
- Maxime Kohlhaas <mko@atm-consulting.fr> - Maxime Kohlhaas <mko@atm-consulting.fr>
- Juanjo Menent <jmenent@2byte.es> - Juanjo Menent <jmenent@2byte.es>
- Alexandre Spangaro <alexandre.spangaro@gmail.com> - Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
- Frederic France <frederic.france@free.fr> - Frederic France <frederic.france@free.fr>
Copyright (C) 2013 Copyright (C) 2013
@ -88,7 +88,7 @@ Copyright (C) 2013
- Maxime Kohlhaas <mko@atm-consulting.fr> - Maxime Kohlhaas <mko@atm-consulting.fr>
- Juanjo Menent <jmenent@2byte.es> - Juanjo Menent <jmenent@2byte.es>
- Adolfo Segura <adolfo.segura@gmail.com> - Adolfo Segura <adolfo.segura@gmail.com>
- Alexandre Spangaro <alexandre.spangaro@gmail.com> - Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
Copyright (C) 2012 Copyright (C) 2012
- Christophe Battarel <christophe.battarel@altairis.fr> - Christophe Battarel <christophe.battarel@altairis.fr>
@ -102,7 +102,7 @@ Copyright (C) 2012
- Maxime Kohlhaas <mko@atm-consulting.fr> - Maxime Kohlhaas <mko@atm-consulting.fr>
- Juanjo Menent <jmenent@2byte.es> - Juanjo Menent <jmenent@2byte.es>
- Nicolas Péré <nicolas@amarok2.net> - Nicolas Péré <nicolas@amarok2.net>
- Alexandre Spangaro <alexandre.spangaro@gmail.com> - Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
Copyright (C) 2011 Copyright (C) 2011
- Laurent Destailleur <eldy@users.sourceforge.net> - Laurent Destailleur <eldy@users.sourceforge.net>

View File

@ -199,36 +199,38 @@ For translators:
NEW: Update language files. NEW: Update language files.
NEW: When a translation is not available we always jump to en_US and only en_US. NEW: When a translation is not available we always jump to en_US and only en_US.
NEW: All language tranlsations (except source en_US) is now managed on https://www.transifex.com/projects/p/dolibarr/. NEW: All language tranlsations (except source en_US) is now managed on https://www.transifex.com/projects/p/dolibarr/.
FIX: Typo errors in translation FIX: Typo errors in translation.
For developers: For developers:
NEW: Function yn can show a visual checkbox. NEW: Function yn can show a visual checkbox.
NEW: Introduced select2 jquery plugin. NEW: Introduced select2 jquery plugin.
NEW: Possibility to add javascript in main login page with "getLoginPageOptions" hook NEW: Possibility to add javascript in main login page with "getLoginPageOptions" hook.
NEW: possibility to defined a tab for all entities in module descriptor NEW: possibility to defined a tab for all entities in module descriptor.
NEW: add restler framework First step to build REST API into Dolibarr NEW: add restler framework First step to build REST API into Dolibarr.
NEW: add an explorer for REST API consultation & documentation NEW: add an explorer for REST API consultation & documentation.
NEW: script to build API class from existing class NEW: script to build API class from existing class.
NEW: Add function dolCopyDir to copy directory with recursive content. NEW: Add function dolCopyDir to copy directory with recursive content.
NEW: Introduce function dolGetFirstLineOfText NEW: Introduce function dolGetFirstLineOfText.
WARNING: Following changes may create regression for some external modules, but was necessary to make WARNING: Following changes may create regression for some external modules, but were necessary to make
Dolibarr better: Dolibarr better:
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the - Removed hook supplierorderdao into supplier order creation. This is a business event, so we must use the
trigger ORDER_SUPPLIER_CREATE instead. trigger ORDER_SUPPLIER_CREATE instead.
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are - Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'" "addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
- All fields "fk_societe" were renamed into "fk_soc". - All fields "fk_societe" and "fk_soc" are now named "fk_soc" (same name for all fields).
- Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType. - Method select_PriceBaseType and load_PriceBaseType were merged into selectPriceBaseType.
- The trigger USER_LOGIN* are deprecated. They are still working but you should prefer use the - The triggers USER_LOGIN* are deprecated. They are still working but you should prefer use the
hook afterLogin or afterLoginFailed instead. hook afterLogin or afterLoginFailed instead.
- The trigger USER_CREATE_FROM_CONTACT has been replace with USER_CREATE and property context is now filled
to make difference between creation from contact or not.
***** ChangeLog for 3.7.2 compared to 3.7.1 ***** ***** ChangeLog for 3.7.2 compared to 3.7.1 *****
FIX [ bug #2855 ] Wrong translation key in localtax report page FIX [ bug #2855 ] Wrong translation key in localtax report page
FIX [ bug #1852 ] JS error when editing a customer order line FIX [ bug #1852 ] JS error when editing a customer order line
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
***** ChangeLog for 3.7.1 compared to 3.7.* ***** ***** ChangeLog for 3.7.1 compared to 3.7.* *****
FIX Bug in the new photo system FIX Bug in the new photo system
@ -485,6 +487,7 @@ Dolibarr better:
- Fix: [ bug #2542 ] Contracts store localtax preferences - Fix: [ bug #2542 ] Contracts store localtax preferences
- Fix: Bad permission assignments for stock movements actions - Fix: Bad permission assignments for stock movements actions
- Fix: [ bug #2891 ] Category hooks do not work - Fix: [ bug #2891 ] Category hooks do not work
- Fix: [ bug #2696 ] Adding complementary attribute fails if code is numerics
***** ChangeLog for 3.6.2 compared to 3.6.1 ***** ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
@ -664,6 +667,10 @@ Fix: [ bug #2861 ] Undefined variable $res when migrating
Fix: [ bug #2837 ] Product list table column header does not match column body Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result
***** ChangeLog for 3.5.6 compared to 3.5.5 ***** ***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973 Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -73,7 +73,7 @@ $obj->socid=$argv[1];
$listofcontractsforcompany=$obj->getListOfContracts('all'); $listofcontractsforcompany=$obj->getListOfContracts('all');
print_r($listofcontractsforcompany); print $listofcontractsforcompany;
// -------------------- END OF YOUR CODE -------------------- // -------------------- END OF YOUR CODE --------------------

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* /*
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
@ -106,13 +106,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$search_desc=''; $search_desc='';
} }
//debug move header to top
llxHeader('', $langs->trans("Accounts"));
//TODO: modify to update all selected product with a sell account //TODO: modify to update all selected product with a sell account
if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) { if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_sell")) {
//print_r ($changeaccount);
$error = 0; $error = 0;
$db->begin(); $db->begin();
@ -121,8 +116,11 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->
$sql1 .= " SET p.accountancy_code_sell=" . $account_number_sell; $sql1 .= " SET p.accountancy_code_sell=" . $account_number_sell;
$sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1); // Debug
print_r ($sql1); // print_r ($sql1);
dol_syslog('accountancy/customer/lines.php::changeaccount product sell sql= ' . $sql1);
$resql1 = $db->query($sql1); $resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
@ -137,7 +135,6 @@ print_r ($sql1);
} }
} }
//TODO: modify to update all selected product with a buy account //TODO: modify to update all selected product with a buy account
if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) { if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->trans("Accountancy_code_buy")) {
$error = 0; $error = 0;
@ -147,9 +144,13 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $action == $langs->
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p"; $sql1 = "UPDATE " . MAIN_DB_PREFIX . "product as p";
$sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy; $sql1 .= " SET p.accountancy_code_buy=" . $account_number_buy;
$sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')'; $sql1 .= ' WHERE p.rowid IN (' . implode(',', $changeaccount) . ')';
print_r ($sql1);
dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1); // Debug
$resql1 = $db->query($sql1); // print_r ($sql1);
dol_syslog('accountancy/customer/lines.php::changeaccount product buy sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) { if (! $resql1) {
$error ++; $error ++;
setEventMessage($db->lasterror(), 'errors'); setEventMessage($db->lasterror(), 'errors');
@ -166,12 +167,10 @@ print_r ($sql1);
/* /*
* View * View
*/ */
//DEBUG elarifr llxHeader('', $langs->trans("Accounts"));
//llxHeader('', $langs->trans("Accounts"));
//For updating account export // For updating account export
print '<script type="text/javascript"> print '<script type="text/javascript">
function launch_export() { function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv"); $("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click(); $("div.fiche div.tabBar form input[type=\"submit\"]").click();

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> /* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
<?PHP <?PHP
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -41,15 +41,23 @@ $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$action = GETPOST('action'); $action = GETPOST('action');
//Select Box
$codeventil = GETPOST('codeventil', 'array'); $codeventil = GETPOST('codeventil', 'array');
$mesCasesCochees = GETPOST('mesCasesCochees', 'array'); $mesCasesCochees = GETPOST('mesCasesCochees', 'array');
//Search Getpost
$search_invoice = GETPOST('search_invoice','alpha');
$search_ref = GETPOST('search_ref','alpha'); $search_ref = GETPOST('search_ref','alpha');
$search_label = GETPOST('search_label','alpha'); $search_label = GETPOST('search_label','alpha');
$search_desc = GETPOST('search_desc','alpha'); $search_desc = GETPOST('search_desc','alpha');
$search_amount = GETPOST('search_amount','alpha');
$search_account = GETPOST('search_account','alpha');
$search_vat = GETPOST('search_vat','alpha');
//Getpost Order and column and limit page
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
//Should move to top with all GETPOST
$page = GETPOST('page'); $page = GETPOST('page');
if ($page < 0) $page = 0; if ($page < 0) $page = 0;
@ -61,17 +69,9 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
} }
$offset = $limit * $page; $offset = $limit * $page;
//End Should move to top with all GETPOST
// TODO : remove comment
//elarifr we can not use only
//$sql .= " ORDER BY l.rowid";
// f.datef will order like FA08 FA09 FA10 FA05 FA06 FA07 FA04...
// f.facnumber will not order properly invoice / avoir / accompte you can have All AC then All AV and all FA
// l.rowid when an invoice is edited rowid are added at end of table & facturedet.rowid are not ordered
//if (! $sortfield) $sortfield="l.rowid";
if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid"; if (! $sortfield) $sortfield="f.datef, f.facnumber, l.rowid";
//if (! $sortorder) $sortorder="DESC";
if (! $sortorder) { if (! $sortorder) {
if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) { if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
$sortorder = " DESC "; $sortorder = " DESC ";
@ -86,20 +86,20 @@ if (! $user->rights->accounting->ventilation->dispatch)
$formventilation = new FormVentilation($db); $formventilation = new FormVentilation($db);
//Defaut AccountingAccount RowId Product / Service
//at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
//so we need to get those default value rowid first
$accounting = new AccountingAccount($db); $accounting = new AccountingAccount($db);
//TODO: we should need to check if result is a really exist accountaccount rowid.....
$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT); $aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT); $aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
// Purge search criteria // Purge search criteria
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter"))
{ {
$search_ref=''; $search_ref='';
$search_invoice='';
$search_label=''; $search_label='';
$search_desc=''; $search_desc='';
$search_amount='';
$search_account='';
$search_vat='';
} }
/* /*
* View * View
@ -107,10 +107,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
llxHeader('', $langs->trans("Ventilation")); llxHeader('', $langs->trans("Ventilation"));
//debug
//print_r($aarowid_s);
//print_r($aarowid_p);
print '<script type="text/javascript"> print '<script type="text/javascript">
$(function () { $(function () {
$(\'#select-all\').click(function(event) { $(\'#select-all\').click(function(event) {
@ -139,7 +135,6 @@ if ($action == 'ventil') {
$mesCodesVentilChoisis = $codeventil; $mesCodesVentilChoisis = $codeventil;
$cpt = 0; $cpt = 0;
foreach ( $mesCasesCochees as $maLigneCochee ) { foreach ( $mesCasesCochees as $maLigneCochee ) {
// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
$maLigneCourante = explode("_", $maLigneCochee); $maLigneCourante = explode("_", $maLigneCochee);
$monId = $maLigneCourante[0]; $monId = $maLigneCourante[0];
$monNumLigne = $maLigneCourante[1]; $monNumLigne = $maLigneCourante[1];
@ -167,29 +162,12 @@ if ($action == 'ventil') {
/* /*
* Customer Invoice lines * Customer Invoice lines
*/ */
$page = GETPOST('page');
if ($page < 0)
$page = 0;
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
$limit = $conf->liste_limit;
} else {
$limit = $conf->liste_limit;
}
$offset = $limit * $page; $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod";
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell";
// A REVOIR elarifr si vraiment necessaire de rajouter , p.fk_product_type as type. le type produit / service est de facto defini pour chaque ligne de facturedet.product_type
// il est donc plus logique de se servir de l.product_type au lieu de p.fk_product_type
$sql .= " , aa.rowid as aarowid"; $sql .= " , aa.rowid as aarowid";
// we need f.datef to reorder lines $sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line";
$sql .= " , f.datef";
// we need to use llx_facturedet l.product_type as used at the time on invoice. if llx_product fk_product_type is changed later it could not change the sell already made !
$sql .= " , l.product_type as type_l";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
@ -197,7 +175,12 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountan
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0"; $sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
// Add search filter like // Add search filter like
if (strlen(trim($search_invoice)))
{
$sql .= " AND (f.facnumber like '%" . $search_invoice . "%')";
}
if (strlen(trim($search_ref))) { if (strlen(trim($search_ref))) {
$sql .= " AND (p.ref like '%" . $search_ref . "%')"; $sql .= " AND (p.ref like '%" . $search_ref . "%')";
} }
@ -207,15 +190,23 @@ if (strlen(trim($search_label))) {
if (strlen(trim($search_desc))) { if (strlen(trim($search_desc))) {
$sql .= " AND (l.description like '%" . $search_desc . "%')"; $sql .= " AND (l.description like '%" . $search_desc . "%')";
} }
if (strlen(trim($search_amount)))
{
$sql .= " AND l.total_ht like '" . $search_amount . "%'";
}
if (strlen(trim($search_account)))
{
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
}
if (strlen(trim($search_vat)))
{
$sql .= " AND (l.tva_tx like '" . $search_vat . "%')";
}
if (! empty($conf->multicompany->enabled)) { if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
} }
//TODO: Remove comment
//replaced by default value $sortfield,$sortorder
//$sql .= " ORDER BY l.rowid";
//if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO > 0) {
// $sql .= " DESC ";
//}
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
@ -226,10 +217,11 @@ if ($result) {
$num_lines = $db->num_rows($result); $num_lines = $db->num_rows($result);
$i = 0; $i = 0;
// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines); print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>'; print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
print_liste_field_titre($langs->trans("Date"), $_SERVER["PHP_SELF"],"f.datef","",$param,'',$sortfield,$sortorder);
print '&nbsp;&nbsp;';
print_liste_field_titre($langs->trans("RowId"), $_SERVER["PHP_SELF"],"l.rowid","",$param,'',$sortfield,$sortorder);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n"; print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
print '<input type="hidden" name="action" value="ventil">'; print '<input type="hidden" name="action" value="ventil">';
@ -240,7 +232,8 @@ if ($result) {
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"p.ref","",$param,'',$sortfield,$sortorder); 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); print_liste_field_titre($langs->trans("Label"), $_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("Description"), $_SERVER["PHP_SELF"],"l.description","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"'); print_liste_field_titre($langs->trans("Amount"),'','','','','align="right"');
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"],"l.tva_tx","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AccountAccounting"),'','','','','align="center"'); print_liste_field_titre($langs->trans("AccountAccounting"),'','','','','align="center"');
print_liste_field_titre($langs->trans("IntoAccount"),'','','','','align="center"'); print_liste_field_titre($langs->trans("IntoAccount"),'','','','','align="center"');
print_liste_field_titre(''); print_liste_field_titre('');
@ -248,21 +241,23 @@ if ($result) {
print '</tr>'; print '</tr>';
// We add search filter // We add search filter
/* But Hit Enter will validate ventilation....
print '<tr class="liste_titre">';
print '<td class="liste_titre" >&nbsp;</td>';
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="30" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" colspan="3">&nbsp;</td>'; print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_invoice" value="' . $search_invoice . '"></td>';
print '<td class="liste_titre">%<input type="text" class="flat" size="15" name="search_ref" value="' . $search_ref . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . $search_desc . '"></td>';
print '<td class="liste_titre" align="right"><input type="text" class="flat" size="10" name="search_amount" value="' . $search_amount. '"></td>';
print '<td class="liste_titre" align="center">%<input type="text" class="flat" size="5" name="search_vat" value="' . $search_vat . '"></td>';
print '<td class="liste_titre" align="center">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">'; 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 '<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 '&nbsp;'; print '&nbsp;';
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
*/
$facture_static = new Facture($db); $facture_static = new Facture($db);
$product_static = new Product($db); $product_static = new Product($db);
$form = new Form($db); $form = new Form($db);
@ -272,21 +267,11 @@ if ($result) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$var = ! $var; $var = ! $var;
// product_type: 0 = service ? 1 = product
// C'est le contraire dans les base !!!!!! IT IS INVERTED IN LLX_PRODUCT & LLX_FACTUREDET
// elarifr define account numbercode comptable si pas defini dans la fiche produit a partir des lignes de facturation
// product_type: 1 = service ? 0 = product
// because some modules like subtotal module l.product_type can be other than 0 or 1 ! and we don't put in account lines with product_type=9
// first we check product.fk_product_type as type and l.product_type as type_l
// if product does not exist we use the value of l.product_type provided in facturedet to define if this is a product or service
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB ! so we report both and user make choice of accounting account.
$objp->code_sell_l = ''; $objp->code_sell_l = '';
$objp->code_sell_p = ''; $objp->code_sell_p = '';
$objp->aarowid_suggest = ''; $objp->aarowid_suggest = '';
$code_sell_p_l_differ = ''; $code_sell_p_l_differ = '';
//check if code_sell defined in product or set default value according p.fk_product_type do not care lines when product_type value not 0 || 1
//and we set suggested accounting account rowid as $objp->aarowid_s
$code_sell_p_notset = ''; $code_sell_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid; $objp->aarowid_suggest = $objp->aarowid;
if ( ! empty($objp->code_sell)) { if ( ! empty($objp->code_sell)) {
@ -300,10 +285,6 @@ if ($result) {
$objp->code_sell_p = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell_p = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
} }
} }
// check facturedet.product_type & set default value according l.type_l, do not care lines when product_type value not 0 || 1
// if ( ! empty($objp->type_l)) {
// $objp->code_sell_l = $objp->type_l;
// } else {
if ($objp->type_l == 1) { if ($objp->type_l == 1) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s; if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_s;
@ -312,10 +293,6 @@ if ($result) {
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p; if ($objp->aarowid == '') $objp->aarowid_suggest = $aarowid_p;
} }
// }
//if not same code for product fk_prouct_type and facturedet.product_type, product has been change after sale and must report
if ($objp->code_sell_l <> $objp->code_sell_p) $code_sell_p_l_differ = 'color:red'; if ($objp->code_sell_l <> $objp->code_sell_p) $code_sell_p_l_differ = 'color:red';
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
@ -324,7 +301,7 @@ if ($result) {
$facture_static->ref = $objp->facnumber; $facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->facid; $facture_static->id = $objp->facid;
print '<td>' . $facture_static->getNomUrl(1) . '</td>'; print '<td>' . $facture_static->getNomUrl(1) . '</td>';
// Ref Customer Invoice // Ref Product
$product_static->ref = $objp->product_ref; $product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id; $product_static->id = $objp->product_id;
$product_static->type = $objp->type; $product_static->type = $objp->type;
@ -336,16 +313,12 @@ if ($result) {
print '</td>'; print '</td>';
print '<td style="' . $code_sell_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>'; print '<td style="' . $code_sell_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>';
//TODO: we should set a user defined value to adjust user square / wide screen size
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32; $trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($objp->description, $trunclength)) . '</td>'; print '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($objp->description, $trunclength)) . '</td>';
print '<td align="right">'; print '<td align="right">';
print price($objp->total_ht); print price($objp->total_ht);
print '</td>'; print '</td>';
print '<td align="center" style="' . $code_sell_p_notset . '">'; print '<td align="center" style="' . $code_sell_p_notset . '">';
// if not same kind of product_type stored in product & facturedet we display both account and let user choose
if ($objp->code_sell_l == $objp->code_sell_p) { if ($objp->code_sell_l == $objp->code_sell_p) {
print $objp->code_sell_l; print $objp->code_sell_l;
} else { } else {
@ -353,21 +326,13 @@ if ($result) {
} }
print '</td>'; print '</td>';
// Colonne choix du compte
print '<td align="center">'; print '<td align="center">';
// TODO: we should set a user defined value to adjust user square / wide screen size
// $trunclengthform = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1); print $formventilation->select_account($objp->aarowid_suggest, 'codeventil[]', 1);
print '</td>'; print '</td>';
print '<td align="center">' . $objp->rowid . '</td>'; print '<td align="center">' . $objp->rowid . '</td>';
// Colonne choix ligne a ventiler
print '<td align="center">'; print '<td align="center">';
//TODO checked only if account exist in product, if only suggested do not check, user must validate print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid_suggest ? "checked" : "") . '/>';
print '</td>'; print '</td>';
//debug
//print '</tr><tr><td colspan=6>Product: p.type='. $objp->type .' - p.code_sell='. $objp->code_sell .' --- Check code_sell_product=' . $objp->code_sell_p .' ---Check facturedet l.type_l='. $objp->type_l .' - code_sell_lines=' . $objp->code_sell_l . ' -- aarowid_suggest=' . $objp->aarowid_suggest.'</td>';
print '</tr>'; print '</tr>';
$i ++; $i ++;
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* *

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com> * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -3,7 +3,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -5,7 +5,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -34,8 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("members"); $langs->load("members");
$rowid = GETPOST('rowid','int'); $rowid = GETPOST('rowid','int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');
$search_lastname = GETPOST('search_lastname','alpha'); $search_lastname = GETPOST('search_lastname','alpha');
$search_login = GETPOST('search_login','alpha'); $search_login = GETPOST('search_login','alpha');
@ -85,7 +86,7 @@ $hookmanager->initHooks(array('membertypecard','globalcard'));
*/ */
if ($action == 'add' && $user->rights->adherent->configurer) if ($action == 'add' && $user->rights->adherent->configurer)
{ {
if ($_POST["button"] != $langs->trans("Cancel")) if (! $cancel)
{ {
$object = new AdherentType($db); $object = new AdherentType($db);
@ -123,7 +124,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
if ($action == 'update' && $user->rights->adherent->configurer) if ($action == 'update' && $user->rights->adherent->configurer)
{ {
if ($_POST["button"] != $langs->trans("Cancel")) if (! $cancel)
{ {
$object = new AdherentType($db); $object = new AdherentType($db);
$object->id = $rowid; $object->id = $rowid;
@ -152,14 +153,6 @@ if ($action == 'delete' && $user->rights->adherent->configurer)
exit; exit;
} }
if ($action == 'commentaire' && $user->rights->adherent->configurer)
{
$don = new Don($db);
$don->fetch($rowid);
$don->update_note(dol_html_entity_decode(GETPOST('commentaire'), ENT_QUOTES));
}
/* /*
* View * View
*/ */
@ -291,7 +284,7 @@ if ($action == 'create')
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("Add").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'">'; print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'" onclick="history.go(-1)" />';
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com> * Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -141,7 +141,7 @@ if ($action == 'edit') // Edit
// Default language // Default language
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'main_lang_default',1); print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'main_lang_default', 1, 0, 0, 0, 0, 'minwidth300');
print '</td>'; print '</td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -77,17 +77,22 @@ if (file_exists($xmlfile))
$xml = simplexml_load_file($xmlfile); $xml = simplexml_load_file($xmlfile);
if ($xml) if ($xml)
{ {
$ret = getFilesUpdated($xml->dolibarr_root_dir[0]); // Fill array $file_list $file_list = array();
$ret = getFilesUpdated($file_list, $xml->dolibarr_root_dir[0]); // Fill array $file_list
print '<table class="noborder">'; print '<table class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>' . $langs->trans("FilesMissing") . '</td>'; print '<td>' . $langs->trans("FilesMissing") . '</td>';
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
$var = true; $var = true;
foreach ($file_list['missing'] as $file) $tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
foreach ($tmpfilelist as $file)
{ {
$var = !$var; $var = !$var;
print '<tr ' . $bc[$var] . '>'; print '<tr ' . $bc[$var] . '>';
print '<td>'.$file.'</td>' . "\n"; print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print "</tr>\n"; print "</tr>\n";
} }
print '</table>'; print '</table>';
@ -97,17 +102,22 @@ if (file_exists($xmlfile))
print '<table class="noborder">'; print '<table class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>' . $langs->trans("FilesUpdated") . '</td>'; print '<td>' . $langs->trans("FilesUpdated") . '</td>';
print '<td align="center">' . $langs->trans("ExpectedChecksum") . '</td>';
print '<td align="center">' . $langs->trans("CurrentChecksum") . '</td>';
print '<td align="right">' . $langs->trans("Size") . '</td>'; print '<td align="right">' . $langs->trans("Size") . '</td>';
print '<td align="center">' . $langs->trans("DateModification") . '</td>'; print '<td align="right">' . $langs->trans("DateModification") . '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
$var = true; $var = true;
foreach ($file_list['updated'] as $file) $tmpfilelist = dol_sort_array($file_list['updated'], 'filename');
foreach ($tmpfilelist as $file)
{ {
$var = !$var; $var = !$var;
print '<tr ' . $bc[$var] . '>'; print '<tr ' . $bc[$var] . '>';
print '<td>'.$file.'</td>' . "\n"; print '<td>'.$file['filename'].'</td>' . "\n";
print '<td align="right">'.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file)).'</td>' . "\n"; print '<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
print '<td align="center">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file),'dayhour').'</td>' . "\n"; print '<td align="center">'.$file['md5'].'</td>' . "\n";
print '<td align="right">'.dol_print_size(dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename'])).'</td>' . "\n";
print '<td align="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'</td>' . "\n";
print "</tr>\n"; print "</tr>\n";
} }
print '</table>'; print '</table>';
@ -124,34 +134,36 @@ $db->close();
/** /**
* Function to get list of updated or modified files * Function to get list of updated or modified files.
* $file_list is used as global variable
* *
* @param SimpleXMLElement $dir SimpleXMLElement of files to test * @param array $file_list Array for response
* @param string $path Path of file * @param SimpleXMLElement $dir SimpleXMLElement of files to test
* @return array Array of filenames * @param string $path Path of file
* @return array Array of filenames
*/ */
function getFilesUpdated(SimpleXMLElement $dir, $path = '') function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '')
{ {
global $file_list;
$exclude = 'install'; $exclude = 'install';
foreach ($dir->md5file as $file) foreach ($dir->md5file as $file)
{ {
$filename = $path.$file['name']; $filename = $path.$file['name'];
if (preg_match('#'.$exclude.'#', $filename)) if (preg_match('#'.$exclude.'#', $filename)) continue;
continue;
if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename)) { if (!file_exists(DOL_DOCUMENT_ROOT.'/'.$filename))
$file_list['missing'][] = $filename; {
} else { $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file);
}
else
{
$md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename); $md5_local = md5_file(DOL_DOCUMENT_ROOT.'/'.$filename);
if ($md5_local != (string) $file) if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local);
$file_list['updated'][] = $filename;
} }
} }
foreach ($dir->dir as $subdir) foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/');
getFilesUpdated($subdir, $path.$subdir['name'].'/');
return $file_list; return $file_list;
} }

View File

@ -172,7 +172,7 @@ jQuery(document).ready(function() {
var compcssstring; var compcssstring;
getcssurl = $.ajax({ getcssurl = $.ajax({
type: "GET", type: "GET",
url: \''.DOL_URL_ROOT.'/includes/jquery/css/smoothness/jquery-ui.custom.css\', url: \''.DOL_URL_ROOT.'/includes/jquery/css/smoothness/jquery-ui.css\',
cache: false, cache: false,
/* async: false, */ /* async: false, */
/*crossDomain: true, */ /*crossDomain: true, */

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -66,6 +66,8 @@ $form=new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$label=$db::LABEL; $label=$db::LABEL;
$type=$db->type;
//var_dump($db);
$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad'; $help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
llxHeader('','',$help_url); llxHeader('','',$help_url);
@ -101,8 +103,8 @@ jQuery(document).ready(function() {
}); });
<?php <?php
if ($label == 'MySQL') print 'jQuery("#radio_dump_mysql").click();'; if (in_array($type, array('mysql', 'mysqli'))) print 'jQuery("#radio_dump_mysql").click();';
if ($label == 'PostgreSQL') print 'jQuery("#radio_dump_postgresql").click();'; if (in_array($type, array('pgsql'))) print 'jQuery("#radio_dump_postgresql").click();';
?> ?>
}); });
</script> </script>
@ -133,7 +135,7 @@ print '<br>';
print_titre($title?$title:$langs->trans("BackupDumpWizard")); print_titre($title?$title:$langs->trans("BackupDumpWizard"));
print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').'">'; print '<table width="100%" class="'.($useinecm?'nobordernopadding':'liste').' nohover">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>'; print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
@ -148,7 +150,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
<div id="div_container_exportoptions"> <div id="div_container_exportoptions">
<fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend> <fieldset id="exportoptions"><legend><?php echo $langs->trans("ExportMethod"); ?></legend>
<?php <?php
if ($label == 'MySQL') if (in_array($type, array('mysql', 'mysqli')))
{ {
?> ?>
<div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" /> <div class="formelementrow"><input type="radio" name="what" value="mysql" id="radio_dump_mysql" />
@ -160,7 +162,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
</div> </div>
<?php <?php
} }
else if ($label == 'PostgreSQL') else if (in_array($type, array('pgsql')))
{ {
?> ?>
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" /> <div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
@ -182,7 +184,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
<div id="div_container_sub_exportoptions"> <div id="div_container_sub_exportoptions">
<?php <?php
if ($label == 'MySQL') if (in_array($type, array('mysql', 'mysqli')))
{ {
?> <!-- Fieldset mysqldump --> ?> <!-- Fieldset mysqldump -->
<fieldset id="mysql_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend> <fieldset id="mysql_options"><legend><?php echo $langs->trans("MySqlExportParameters"); ?></legend>
@ -317,7 +319,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
<?php <?php
} }
if ($label == 'PostgreSQL') if (in_array($type, array('pgsql')))
{ {
?> <!-- Fieldset pg_dump --> ?> <!-- Fieldset pg_dump -->
<fieldset id="postgresql_options"><legend><?php echo $langs->trans("PostgreSqlExportParameters"); ?></legend> <fieldset id="postgresql_options"><legend><?php echo $langs->trans("PostgreSqlExportParameters"); ?></legend>
@ -382,9 +384,9 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
value="<?php value="<?php
$prefix='dump'; $prefix='dump';
$ext='.sql'; $ext='.sql';
if ($label == 'MySQL') { $prefix='mysqldump'; $ext='sql'; } if (in_array($type, array('mysql', 'mysqli'))) { $prefix='mysqldump'; $ext='sql'; }
//if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='dump'; } //if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='dump'; }
if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='sql'; } if (in_array($type, array('pgsql'))) { $prefix='pg_dump'; $ext='sql'; }
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext; $file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
echo $file; echo $file;
?>" /> <br> ?>" /> <br>
@ -394,7 +396,7 @@ echo $file;
// Define compressions array // Define compressions array
$compression=array(); $compression=array();
if ($label == 'MySQL') if (in_array($type, array('mysql', 'mysqli')))
{ {
$compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None"));
$compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip"));

View File

@ -289,7 +289,7 @@ if ($result)
if ($num) if ($num)
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
print '</div>'; print '</div>';
} }
} }

View File

@ -6,7 +6,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,7 +3,7 @@
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1263,7 +1263,7 @@ class AccountLine extends CommonObject
if ($this->rappro) if ($this->rappro)
{ {
// Protection to avoid any delete of consolidated lines // Protection to avoid any delete of consolidated lines
$this->error="DeleteNotPossibleLineIsConsolidated"; $this->error="ErrorDeleteNotPossibleLineIsConsolidated";
return -1; return -1;
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr> * Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -181,7 +181,7 @@ if ($resql)
$var=True; $var=True;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print_fiche_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$acct->id.'">'.$acct->label.'</a>','title_bank.png'); print_fiche_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$acct->id.'">'.$acct->label.'</a>', '', 'title_bank.png');
print '<br>'; print '<br>';
// Show last bank receipts // Show last bank receipts

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *

View File

@ -6,7 +6,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -218,6 +218,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type);
dol_fiche_head($head,'byyear',$langs->trans("Statistics")); dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1);
//Array passed as an argument to Form::selectarray to build a proper select input
$companies = array();
foreach ($tmp_companies as $value) {
$companies[$value['value']] = $value['label'];
}
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
@ -233,7 +240,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>'; print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'customer') $filter='s.client in (1,2,3)';
if ($mode == 'supplier') $filter='s.fournisseur = 1'; if ($mode == 'supplier') $filter='s.fournisseur = 1';
print $form->select_company($socid,'socid',$filter,1); print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"');
print '</td></tr>'; print '</td></tr>';
// User // User
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'; print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com> /* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2014 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2012 Alexandre spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2012 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>

View File

@ -4,7 +4,7 @@
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -460,7 +460,7 @@ class RemiseCheque extends CommonObject
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->bank->cheque->warning_delay/60/60/24; $response->warning_delay=$conf->bank->cheque->warning_delay/60/60/24;
$response->label=$langs->trans("BankChecksToReceipt"); $response->label=$langs->trans("BankChecksToReceipt");
$response->url=DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=accountancy'; $response->url=DOL_URL_ROOT.'/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=bank';
$response->img=img_object($langs->trans("BankChecksToReceipt"),"payment"); $response->img=img_object($langs->trans("BankChecksToReceipt"),"payment");
while ($obj=$this->db->fetch_object($resql)) while ($obj=$this->db->fetch_object($resql))

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -87,7 +87,7 @@ class RejetPrelevement
dol_syslog("RejetPrelevement::Create id $id"); dol_syslog("RejetPrelevement::Create id $id");
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT; $bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
$facs = $this->getListInvoices(); $facs = $this->getListInvoices(1);
$this->db->begin(); $this->db->begin();
@ -132,7 +132,7 @@ class RejetPrelevement
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$fac = new Facture($this->db); $fac = new Facture($this->db);
$fac->fetch($facs[$i]); $fac->fetch($facs[$i][0]);
// Make a negative payment // Make a negative payment
$pai = new Paiement($this->db); $pai = new Paiement($this->db);
@ -144,7 +144,7 @@ class RejetPrelevement
* PHP installs sends only the part integer negative * PHP installs sends only the part integer negative
*/ */
$pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1); $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1);
$pai->datepaye = $date_rejet; $pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal $pai->paiementid = 3; // type of payment: withdrawal
$pai->num_paiement = $fac->ref; $pai->num_paiement = $fac->ref;
@ -152,7 +152,7 @@ class RejetPrelevement
if ($pai->create($this->user) < 0) // we call with no_commit if ($pai->create($this->user) < 0) // we call with no_commit
{ {
$error++; $error++;
dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i]); dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]);
} }
else else
{ {
@ -270,22 +270,24 @@ class RejetPrelevement
} }
/** /**
* Retrieve the list of invoices * Retrieve the list of invoices
* *
* @return array * @param int $amounts If you want to get the amount of the order for each invoice
* @return array Array List of invoices related to the withdrawal line
* @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ?
*/ */
private function getListInvoices() private function getListInvoices($amounts=0)
{ {
global $conf; global $conf;
$arr = array(); $arr = array();
//Returns all invoices of a withdrawal //Returns all invoices of a withdrawal
$sql = "SELECT f.rowid as facid"; $sql = "SELECT f.rowid as facid, pl.amount";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)";
$sql.= " WHERE pf.fk_prelevement_lignes = ".$this->id; $sql.= " WHERE pf.fk_prelevement_lignes = ".$this->id;
$sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.entity = ".$conf->entity;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -299,7 +301,14 @@ class RejetPrelevement
while ($i < $num) while ($i < $num)
{ {
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_row($resql);
$arr[$i] = $row[0]; if (!$amounts) $arr[$i] = $row[0];
else
{
$arr[$i] = array(
$row[0],
$row[1]
);
}
$i++; $i++;
} }
} }
@ -307,7 +316,7 @@ class RejetPrelevement
} }
else else
{ {
dol_syslog("RejetPrelevement Erreur"); dol_syslog("getListInvoices", LOG_ERR);
} }
return $arr; return $arr;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com> * Copyright (C) 2015 Charlie BENKE <charlie@patas-monkey.com>

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/compta/sociales/charges.php * \file htdocs/compta/sociales/charges.php
* \ingroup tax * \ingroup tax
* \brief Social contribution car page * \brief Social contribution card page
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -387,7 +387,7 @@ if ($id > 0)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $total = 0; $i = 0; $total = 0;
echo '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("RefPayment").'</td>'; print '<td>'.$langs->trans("RefPayment").'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
@ -488,7 +488,7 @@ if ($id > 0)
/* /*
* Boutons actions * Actions buttons
*/ */
if ($action != 'edit') if ($action != 'edit')
{ {
@ -500,7 +500,7 @@ if ($id > 0)
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=edit\">".$langs->trans("Modify")."</a>";
} }
// Emettre paiement // Emit payment
if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->tax->charges->creer) if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->tax->charges->creer)
{ {
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/paiement_charge.php?id=$object->id&amp;action=create\">".$langs->trans("DoPayment")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/paiement_charge.php?id=$object->id&amp;action=create\">".$langs->trans("DoPayment")."</a>";

View File

@ -317,16 +317,19 @@ class PaymentSocialContribution extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
dol_syslog(get_class($this)."::delete");
$this->db->begin(); $this->db->begin();
if (! $error) if ($this->bank_line > 0)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; $accline = new AccountLine($this->db);
$sql.= " WHERE type='payment_sc' AND url_id=".$this->id; $accline->fetch($this->bank_line);
$result = $accline->delete();
dol_syslog(get_class($this)."::delete", LOG_DEBUG); if($result < 0) {
$resql = $this->db->query($sql); $this->errors[] = $accline->error;
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } $error++;
}
} }
if (! $error) if (! $error)

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -90,9 +90,8 @@ if (empty($min)) {
// Define modetax (0 or 1) // Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit // 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE; $modetax = $conf->global->TAX_MODE;
if (isset($_REQUEST["modetax"])) { if (isset($_REQUEST["modetax"])) $modetax=$_REQUEST["modetax"];
$modetax=$_REQUEST["modetax"]; if (empty($modetax)) $modetax=0;
}
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007, 2015 Yannick Warnier <ywarnier@beeznest.org> * Copyright (C) 2006-2007, 2015 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -252,7 +252,7 @@ $vatsup=$langs->trans("VATPaid");
// VAT Received and paid // VAT Received and paid
echo '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$y = $year_current; $y = $year_current;
$total = 0; $total = 0;
@ -538,8 +538,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
// Blank line // Blank line
print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>'; print '<tr><td colspan="'.($span+1).'">&nbsp;</td></tr>';
//print table headers for this quadri - expenses now // Print table headers for this quadri - expenses now
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="left">'.$elementsup.'</td>'; print '<td align="left">'.$elementsup.'</td>';
print '<td align="left">'.$langs->trans("Date").'</td>'; print '<td align="left">'.$langs->trans("Date").'</td>';
@ -680,7 +679,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
print '</tr>'; print '</tr>';
} }
if (count($x_paye) == 0) { // Show a total ine if nothing shown if (count($x_paye) == 0) { // Show a total line if nothing shown
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td colspan="'.$span.'"></td>'; print '<td colspan="'.$span.'"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>'; print '<td align="right">'.$langs->trans("Total").':</td>';
@ -706,7 +705,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
$i++; $i++;
} }
echo '</table>'; print '</table>';
$db->close(); $db->close();

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
@ -809,7 +809,7 @@ else
print '</tr>'; print '</tr>';
// Jabberid // Jabberid
print '<tr><td><label for="jabberid">'.$langs->trans("Jabberid").'</label></td>'; print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
print '<td><input name="jabberid" id="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>'; print '<td><input name="jabberid" id="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
if (! empty($conf->mailing->enabled)) if (! empty($conf->mailing->enabled))
{ {

View File

@ -6,7 +6,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
@ -568,7 +568,7 @@ class Contact extends CommonObject
$this->country_id = $obj->country_id; $this->country_id = $obj->country_id;
$this->country_code = $obj->country_id?$obj->country_code:''; $this->country_code = $obj->country_id?$obj->country_code:'';
$this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):'';
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->socname = $obj->socname; $this->socname = $obj->socname;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -36,6 +36,8 @@ $contactid = GETPOST("id",'int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe');
$contact = new Contact($db);
/* /*
@ -45,23 +47,23 @@ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("
llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
if ($contactid > 0)
{
$result = $contact->fetch($contactid, $user);
$contact = new Contact($db); $contact->info($contactid);
$contact->fetch($contactid, $user);
$contact->info($contactid);
$head = contact_prepare_head($contact); $head = contact_prepare_head($contact);
dol_fiche_head($head, 'info', $title, 0, 'contact'); dol_fiche_head($head, 'info', $title, 0, 'contact');
// TODO Put here ref of card
print '<table width="100%"><tr><td>'; dol_print_object_info($contact);
print '</td></tr></table>';
dol_print_object_info($contact); dol_fiche_end();
}
print "</div>";
llxFooter(); llxFooter();

View File

@ -40,7 +40,10 @@ if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db); $contact = new Contact($db);
$contact->fetch($id, $user); if ($id > 0)
{
$contact->fetch($id, $user);
}
/* /*
@ -132,7 +135,8 @@ print '<tr><td>LDAP '.$langs->trans("LDAPServerPort").'</td><td class="valeur" c
print '</table>'; print '</table>';
print '</div>'; dol_fiche_end();
/* /*
* Barre d'actions * Barre d'actions
@ -204,6 +208,6 @@ print '</table>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2013-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -28,14 +28,20 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php';
$contact = new Contact($db);
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
// Security check // Security check
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$contact = new Contact($db);
$result=$contact->fetch($id); $result=$contact->fetch($id);
if (! $result)
{
dol_print_error($contact->error);
exit;
}
$physicalperson=1; $physicalperson=1;
@ -43,7 +49,6 @@ $company = new Societe($db);
if ($contact->socid) if ($contact->socid)
{ {
$result=$company->fetch($contact->socid); $result=$company->fetch($contact->socid);
//print "ee";
} }
// We create VCard // We create VCard
@ -100,4 +105,3 @@ header("Connection: close");
header("Content-Type: text/x-vcard; name=\"".$filename."\""); header("Content-Type: text/x-vcard; name=\"".$filename."\"");
print $output; print $output;

View File

@ -905,7 +905,8 @@ class Contrat extends CommonObject
$modCodeContract = new $module(); $modCodeContract = new $module();
} }
if (!empty($modCodeContract->code_auto)) { //Commerce Efficace - Debut : Modification r<>f<EFBFBD>rence Contrat
/*if (!empty($modCodeContract->code_auto)) {
// Mise a jour ref // Mise a jour ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
@ -915,7 +916,8 @@ class Contrat extends CommonObject
$this->ref="(PROV".$this->id.")"; $this->ref="(PROV".$this->id.")";
} }
} }
} }*/
//Commerce Efficace - Fin : Modification r<>f<EFBFBD>rence Contrat
// Insert contacts commerciaux ('SALESREPSIGN','contrat') // Insert contacts commerciaux ('SALESREPSIGN','contrat')
$result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal'); $result=$this->add_contact($this->commercial_signature_id,'SALESREPSIGN','internal');

View File

@ -125,7 +125,7 @@ if ($action == 'add')
if (! $error) if (! $error)
{ {
// attrname must be alphabetical and lower case only // attrname must be alphabetical and lower case only
if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname'])) if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname']) && !is_numeric($_POST["attrname"]))
{ {
// Construct array for parameter (value of select list) // Construct array for parameter (value of select list)
$default_value = GETPOST('default_value'); $default_value = GETPOST('default_value');

View File

@ -25,7 +25,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Required to knwo date format for dol_print_date //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Required to know date format for dol_print_date
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
@ -50,7 +50,7 @@ top_httphead();
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext')
{ {
// Increase date // Increase date
$al =new AccountLine($db); $al = new AccountLine($db);
$al->datev_next($_GET["rowid"]); $al->datev_next($_GET["rowid"]);
$al->fetch($_GET["rowid"]); $al->fetch($_GET["rowid"]);

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2011-2015 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,6 +26,7 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1');
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

View File

@ -105,6 +105,7 @@ class box_members extends ModeleBoxes
$memberstatic->lastname=$objp->lastname; $memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname; $memberstatic->firstname=$objp->firstname;
$memberstatic->id = $objp->rowid;
$memberstatic->ref = $objp->rowid; $memberstatic->ref = $objp->rowid;
if (! empty($objp->fk_soc)) { if (! empty($objp->fk_soc)) {

View File

@ -122,7 +122,7 @@ class box_task extends ModeleBoxes
// Add the sum à the bottom of the boxes // Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" colspan="2" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead); $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks")); $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5)); $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5)); $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));

View File

@ -33,6 +33,18 @@
abstract class CommonDocGenerator abstract class CommonDocGenerator
{ {
var $error=''; var $error='';
protected $db;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db) {
$this->db = $db;
return 1;
}
/** /**

View File

@ -352,7 +352,7 @@ abstract class CommonObject
$sql = "SELECT rowid, ref, ref_ext"; $sql = "SELECT rowid, ref, ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX.$element; $sql.= " FROM ".MAIN_DB_PREFIX.$element;
$sql.= " WHERE entity IN (".getEntity($element,1).")" ; $sql.= " WHERE entity IN (".getEntity($element, true).")" ;
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
@ -3532,7 +3532,8 @@ abstract class CommonObject
/** /**
* Call trigger based on this instance * Call trigger based on this instance.
* Some context information may also be provided into array property this->context.
* NB: Error from trigger are stacked in interface->errors * NB: Error from trigger are stacked in interface->errors
* NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction. * NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
* *

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> /* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -15,7 +15,7 @@
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -984,7 +984,7 @@ class Form
$out.= '<option value="'.$obj->rowid.'">'.$label.'</option>'; $out.= '<option value="'.$obj->rowid.'">'.$label.'</option>';
} }
array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name)); array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->rowid, 'label'=>$label));
$i++; $i++;
if (($i % 10) == 0) $out.="\n"; if (($i % 10) == 0) $out.="\n";
@ -2384,6 +2384,8 @@ class Form
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
$langs->load('propal');
$sql = "SELECT rowid, code, label"; $sql = "SELECT rowid, code, label";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_availability'; $sql.= " FROM ".MAIN_DB_PREFIX.'c_availability';
$sql.= " WHERE active > 0"; $sql.= " WHERE active > 0";
@ -3217,11 +3219,11 @@ class Form
{ {
foreach ($formquestion as $key => $input) foreach ($formquestion as $key => $input)
{ {
if (isset($input['name'])) array_push($inputok,$input['name']); //print "xx ".$key." rr ".is_array($input)."<br>\n";
if (is_array($input) && isset($input['name'])) array_push($inputok,$input['name']);
if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko,$input['name']); if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko,$input['name']);
} }
} }
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template // Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">'; $formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
if (! empty($more)) { if (! empty($more)) {

View File

@ -54,9 +54,10 @@ class FormAdmin
* @param int $showempty Add empty value * @param int $showempty Add empty value
* @param int $showwarning Show a warning if language is not complete * @param int $showwarning Show a warning if language is not complete
* @param int $disabled Disable edit of select * @param int $disabled Disable edit of select
* @param string $morecss Add more css styles
* @return string Return HTML select string with list of languages * @return string Return HTML select string with list of languages
*/ */
function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=0,$showempty=0,$showwarning=0,$disabled=0) function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=0,$showempty=0,$showwarning=0,$disabled=0,$morecss='')
{ {
global $langs; global $langs;
@ -64,7 +65,7 @@ class FormAdmin
$out=''; $out='';
$out.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>'; $out.= '<select class="flat'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'"'.($disabled?' disabled':'').'>';
if ($showempty) if ($showempty)
{ {
$out.= '<option value=""'; $out.= '<option value=""';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -50,7 +50,7 @@ class Interfaces
* This function call all qualified triggers. * This function call all qualified triggers.
* *
* @param string $action Trigger event code * @param string $action Trigger event code
* @param object $object Objet concern * @param object $object Objet concerned. Some context information may also be provided into array property object->context.
* @param User $user Objet user * @param User $user Objet user
* @param Lang $langs Objet lang * @param Lang $langs Objet lang
* @param Conf $conf Objet conf * @param Conf $conf Objet conf

View File

@ -150,7 +150,7 @@ class vCard
{ {
$this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); $this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix);
$this->filename = "$first%20$family.vcf"; $this->filename = "$first%20$family.vcf";
if ($this->properties["FN"]=="") $this->setFormattedName(trim("$prefix $first $additional $family $suffix")); if (empty($this->properties["FN"])) $this->setFormattedName(trim("$prefix $first $additional $family $suffix"));
} }
/** /**

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

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