diff --git a/ChangeLog b/ChangeLog index 68ccd4e50df..f4b13d1e3ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,69 +24,65 @@ Dolibarr better: - Function delete of class Facture (invoice) need the object $user as first parameter. Also you must check you make a fetch on object before calling the delete. - The old driver of "mysql" has been removed. Dolibarr use the new one (mysqli) by default. +- Remove not used function calculate_byte(). Use dol_print_size() instead. +- Function pdf_getTotalQty is now deprecated. Not used by Dolibarr core. ***** ChangeLog for 4.0.0 compared to 3.9.* ***** For users: -NEW: Add reccuring invoice feature and automatic generation of invoices. +NEW: Add recurring invoice feature and automatic generation of invoices. NEW: Add module "Loan" as stable. -NEW: Add module "Supplier commercial proposal" (price request) is set to stable status. -NEW: Experimental module Accountancy Expert -NEW: Experimental module Multicurency -NEW: Show into badge on tab head the number of dedicated contacts for all objects. +NEW: Add module "Supplier commercial proposal" (price request) with stable status. +NEW: Can select dynamicaly number of lines to show on page on product, shipment, contact, orders, thirdparties. +NEW: Can select fields to show on list also for list of customer orders, supplier orders, shipments, proposals and invoices. +NEW: Show into badge on tab head, the number of dedicated contacts for all objects. NEW: Add a checkbox to select/unselect all lines on page that support mass actions (like invoice list page) -NEW: Add a new method for margin calculation. Added margin on "cost price" to margin on WAP price and margin on "best supplier price". +NEW: Add a new method for margin calculation. Added margin on "cost price" in addition to margin on WAP price and margin on "best supplier price". NEW: Add an explanation message on shipment page to explain you can't make shipment if order is not validated NEW: Add date_rum into table of thirdparty bank account. NEW: The probability of lead/opportunity can be defined per lead. NEW: Added Malta VAT into migration script -NEW: #4972 Translated Charges sociales (type 0) and Charges sociales (type 1) in reports page NEW: Add Expense report into accountancy report NEW: Add Expense report to approve into workboard -NEW: Selection of boxes is move on top of home page -NEW: Add filter on a keyword, status and nature into list of modules +NEW: Selection of boxes is moved on top of home page +NEW: Add filter on a keyword, status and nature into list of modules. NEW: Add hidden option BANK_DISABLE_CHECK_DEPOSIT to disable check deposit feature. -NEW: Add option MAIN_PUBLIC_NOTE_IN_ADDRESS -NEW: add html id/class to locate value in the DOM html +NEW: Add hidden option MAIN_PUBLIC_NOTE_IN_ADDRESS NEW: Add index on invoice status -NEW: Add constant MAIN_LOGTOHTML to 0 into other setup by default to save time when we need to make debug on hosted instance. +NEW: Add constant MAIN_LOGTOHTML to 0 into setup by default to save time when we need to make debug on hosted instance. NEW: Add list of billed NEW: Add minimum stock and desired stock into import/export profiles. -NEW: Add state into thirdparty export fields +NEW: Add state into thirdparty export fields. NEW: Add more trackable events (create, submit and receive supplier order). -NEW: Add option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN +NEW: Add hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN NEW: Add picto on module list to show warning and if module is an external module. -NEW: add product type filter on turnover report +NEW: Add product type filter on turnover report NEW: Add state into list of fields available for personalized fields of thirdparties NEW: Add statistics for interventions module NEW: Add statistics on number of projets on home page -NEW: Add stats and late records into dashboard for supplier proposals. +NEW: Add statistics and late records into dashboard for supplier proposals. NEW: Add the admin info on combo of type of contact -NEW: Add the event BILL_PAYED to list of supported events for module notification. -NEW: Add total weight and volume on PDF +NEW: Add the event BILL_PAYED to the list of supported events for module notification. +NEW: Add total weight and volume on PDF. NEW: Add hidden option to hide column qty ordered on shipments. -NEW: Add view of virtual stock into product list (when appropriate) -NEW: Add warning on tasks when they are late (add also the warning tolerance parameter) -NEW: Add weight/volume for one product into shipment export +NEW: Add view of virtual stock into product list (when appropriate). +NEW: Add warning on tasks when they are late (add also the warning tolerance parameter). +NEW: Add weight/volume for one product into shipment export. NEW: Add width and height on product card -NEW: allow a document to be linked to project from another customer on config -NEW: allow project to be shared across entities (for multicompany module) +NEW: allow a document to be linked to project of another customer by config setup. +NEW: allow project to be shared across entities (for multicompany module). NEW: All variant of ckeditor config can be tested into the setup page of module. NEW: Can change dynamically number of records visible into lists. -NEW: Can change type of extrafields for some combinations. -NEW: Can define number of first and last line into import wizard. +NEW: Can change type of extrafields (for some combinations only). +NEW: Can define number of first and last line to import into import wizard. NEW: Can edit next execution date of a cron job. NEW: Can edit value date of a vat payment after recording it. -NEW: Can filter modules on publisher -NEW: Can filter on employee status when building emailing from users -NEW: Can reopen an closed shipment -NEW: Can search on shipments into the quick search box -NEW: Can select dynamicaly number of lines to show on page on product, shipment, contact, orders, thirdparties -NEW: Can select fields to show on supplier orders list. -NEW: Can select fields to show on list also for list of customer orders, shipments and invoices. -NEW: Can select fields to show on proposal lists. -NEW: Can select language from combo list on page to overwrite a translation +NEW: Can filter modules on publisher. +NEW: Can filter on employee status when building emailing from users. +NEW: Can reopen an closed shipment. +NEW: Can search on shipments into the quick search box. +NEW: Can select language from a combo list on page to overwrite a translation. NEW: Can select number of lines on page list for projects and tasks. NEW: Can use ^ and $ (to say start with or end with like regex syntax) into search fields when search field is text. Bonus: ^$ can filter all lines with field not defined. NEW: Clean and enhance code for cron engine @@ -108,32 +104,35 @@ NEW: Into GED module, filename is truncated only if there is not enough space in NEW: Introduce a predefined job to run database backup NEW: Introduce option MAIN_WEIGHT_DEFAULT_UNIT and MAIN_VOLUME_DEFAULT_UNIT to force output unit for weight and volume. NEW: Introduce position of records into dictionnary of type of contacts -NEW: Link on user in leave context reach to leave tab. -NEW: List of user in agenda view per user show photo thumb +NEW: Link on a user in leave page reach to leave tab of user. +NEW: List of user in agenda view per user show photo thumb. NEW: Margins module - Check/update buying price on invoice lines NEW: Merge all admin tools (system and module admin tools) into same entry "Admin tools", so now things are clear: All features restricted to an admin user is inside "setup" (for setup) or "admin tools" (for action tools) instead of 3 different entries. NEW: Merge all boxes "related objects" into one. This save a lot of room on most card and avoid often horizontal scoll. NEW: Moved code that deals with bank categories to BankCateg. Created BankCateg::fetchAll function -NEW: Move Expense report menu from module to menu files -NEW: Move HRM dictionary from module to core dictionaries +NEW: Move HRM dictionary from module to core dictionaries. NEW: Mutualize code to manage email substitution variables. Show available variables into page to edit email templates. NEW: Mutualize code: Use one call of function "addThumbs", when possible, to generate thumbs files instead of several call of "vignette" function. NEW: On translation admin page, admin can overwrite a translation value. -NEW: Option MAIN_LIST_FILTER_ON_DAY is supported on proposal list -NEW: Add reputation field for price supplier -NEW: Rest API token is no more reset at each call. We can reset it with param reset=1 on login call. +NEW: Option MAIN_LIST_FILTER_ON_DAY is supported on proposal list. +NEW: Add reputation field for price supplier. NEW: Selection of fields is available on member list. NEW: Show a badge with number of withdraw requests done on the withdraw tab of invoice. -NEW: Add option to show detail per warehouse into reassort -NEW: Show total number of modules into the module list +NEW: Add option to show detail per warehouse into reassort. +NEW: Show total number of modules into the module list. NEW: Survey system has now a status like other objects. You can close or reopen a survey. -NEW: The note on time spent can be entered when using the view per day. -NEW: Use ellipsis truncation on too large left menu text +NEW: The note on time spent can be entered when using the "view per day". +NEW: Use ellipsis truncation on too large left menu text. NEW: When a new field to show into lists is selected, the form is automatically submited and field added. NEW: When creating a template invoice from a draft invoice, if there is link to contract on draft invoice, link is kept on template invoice. NEW: When emailing is not sent completely, show progression. +NEW: Experimental module Accountancy Expert. +NEW: Experimental module Multicurency For developers: +NEW: Add entity field in llx_societe_remise_except and llx_societe_remise. +NEW: Rest API token is no more reset at each call. We can reset it with param reset=1 on login call. +NEW: Add html id/class to locate value in the DOM html NEW: Add a css class style called 'reposition', so when clicking on a link with this class will move scrollbarr to be placed at same page location. NEW: TimeZone can be supplied to mktime NEW: hook in shipment card @@ -153,8 +152,9 @@ NEW: Removed deprecated CommonObject::client property. Please use CommonObject:: NEW: Removed unused FormOrder::selectSourcesCommande function NEW: Renamed ActionComm::add function to ActionComm::create NEW: Rename Form::select_date to Form::selectDate and Form::form_date to Form::formDate -NEW: Rename path for generiN +NEW: Rename path for generic media files NEW: More phpunit tests. Include some REST API into automatic tests. +NEW: Move Expense report menu from module to menu files. WARNING: diff --git a/README-FR.md b/README-FR.md index 55065d5d15f..41edb8ba50e 100644 --- a/README-FR.md +++ b/README-FR.md @@ -25,7 +25,7 @@ OpenSuse, Mandriva ou Mageia). Vous pouvez les télécharger depuis la rubrique *download* du portail officiel: https://www.dolibarr.org/ -Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql), +Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (MariaDb/MySql/PostgreSql), vous pouvez installer Dolibarr avec cette version de la manière suivante: - Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur @@ -117,8 +117,8 @@ Voir fichier ChangeLog. - Application simple à utiliser. - Plusieurs thèmes visuels. - Code simple et facilement personnalisable. -- Requiert PHP et Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis). -- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP ou Postgresql. +- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis). +- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP. - Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) diff --git a/README.md b/README.md index 3eb0941568a..64579486985 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM ### Advanced setup -You can use a Web server and a supported database (MySQL recommended) to install the standard version. +You can use a Web server and a supported database (MariaDb, MySql or Postgresql) to install the standard version. - Uncompress the downloaded archive - Copy directory "dolibarr" and all its files inside your web server root, or copy directory anywhere and set up your web server to use "dolibarr/htdocs" as root for a new web server virtual host (second choice need to be server administrator) @@ -119,7 +119,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Can manage several currencies by adding external module multi-currency. - Very user friendly and easy to use - Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one) -- Works with PHP 5.3+ and MySQL 4.1+ or PostgreSQL 8.1. (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite)) +- Works with PHP 5.3+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](http://wiki.dolibarr.org/index.php/Prerequisite)) - Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. - An easy to understand, maintain and code interfaces with your own information system (PHP with no heavy framework; trigger and hook architecture) - Support for country specific features: diff --git a/build/debian/control b/build/debian/control index 9a76856505a..d5c4a913713 100755 --- a/build/debian/control +++ b/build/debian/control @@ -26,11 +26,11 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | # Misc dependencies # fonts-dejavu-core | ttf-dejavu-core, xdg-utils, - mysql-server, - mysql-client, + virtual-mysql-client, ${misc:Depends}, ${perl:Depends} -Recommends: apache2 | lighttpd | httpd +Recommends: apache2 | lighttpd | httpd, + virtual-mysql-server Suggests: www-browser, php5-geoip Description: Web based software to manage a company or foundation Dolibarr ERP & CRM is an easy to use open source/free software package for diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 809f279756c..ac735c59e0d 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -603,7 +603,7 @@ if ($nboftargetok) { if ($target eq 'TGZ') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } @@ -635,7 +635,7 @@ if ($nboftargetok) { if ($target eq 'XZ') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } @@ -672,7 +672,7 @@ if ($nboftargetok) { if ($target eq 'ZIP') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/standard'); if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; } @@ -713,7 +713,7 @@ if ($nboftargetok) { if ($target =~ /FEDO/i) { $subdir="package_rpm_redhat-fedora"; } if ($target =~ /MAND/i) { $subdir="package_rpm_mandriva"; } if ($target =~ /OPEN/i) { $subdir="package_rpm_opensuse"; } - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/'.$subdir); if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; } @@ -799,7 +799,7 @@ if ($nboftargetok) { if ($target eq 'DEB') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/package_debian-ubuntu'); if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; } @@ -1002,7 +1002,7 @@ if ($nboftargetok) { if ($target eq 'APS') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/package_aps'); if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; } @@ -1088,7 +1088,7 @@ if ($nboftargetok) { if ($target eq 'EXEDOLIWAMP') { $NEWDESTI=$DESTI; - if ($NEWPUBLISH =~ /stable/) + if ($NEWDESTI =~ /stable/) { mkdir($DESTI.'/package_windows'); if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; } diff --git a/composer.json b/composer.json index 87f9822f376..dbe3b9e303f 100644 --- a/composer.json +++ b/composer.json @@ -2,14 +2,22 @@ "name": "dolibarr/dolibarr", "type": "project", "description": "Dolibarr ERP & CRM is a modern and easy to use web software to manage your business", - "keywords": ["erp","crm","invoice","sme","proposal","order","stock"], - "homepage": "http://www.dolibarr.org", + "keywords": [ + "erp", + "crm", + "invoice", + "sme", + "proposal", + "order", + "stock", + "agenda" + ], + "homepage": "https://www.dolibarr.org", "license": "GPL-3.0+", "support": { "issues": "https://github.com/Dolibarr/dolibarr/issues", - "forum": "http://www.dolibarr.org/forum", - "wiki": "http://wiki.dolibarr.org", - "irc": "irc://chat.freenode.net/dolibarr", + "forum": "https://www.dolibarr.org/forum", + "wiki": "https://wiki.dolibarr.org", "source": "https://github.com/Dolibarr/dolibarr" }, "config": { @@ -48,6 +56,5 @@ "ext-zip": "ODT and Excel support", "ext-xml": "Excel support", "firephp/firephp-core": "Logging to Firebug console support", - "raven/raven": "Sentry logging server support" } } diff --git a/doc/images/dolibarr_screenshot1_1280x800.jpg b/doc/images/dolibarr_screenshot1_1280x800.jpg new file mode 100644 index 00000000000..c6d5776d1fc Binary files /dev/null and b/doc/images/dolibarr_screenshot1_1280x800.jpg differ diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 1dcb2a533de..057e2f0484c 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -69,10 +69,10 @@ if ($action == 'add') { $account_number = clean_account(GETPOST('account_number')); } - if (GETPOST('account_category') <= 0) { - $account_parent = ''; + if (GETPOST('account_parent') <= 0) { + $account_parent = 0; } else { - $account_parent = GETPOST('account_category','int'); + $account_parent = GETPOST('account_parent','int'); } $object->fk_pcg_version = $obj->pcg_version; @@ -98,7 +98,7 @@ if ($action == 'add') { header("Location: account.php"); exit; } else if ($action == 'edit') { - if (! GETPOST('cancel', 'alpha')) { + if (! $cancel) { $result = $object->fetch($id); $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; @@ -119,10 +119,10 @@ if ($action == 'add') { $account_number = clean_account(GETPOST('account_number')); } - if (GETPOST('account_category') <= 0) { - $account_parent = ''; + if (GETPOST('account_parent') <= 0) { + $account_parent = 0; } else { - $account_parent = GETPOST('account_category','int'); + $account_parent = GETPOST('account_parent','int'); } $object->fk_pcg_version = $obj->pcg_version; @@ -165,7 +165,9 @@ if ($action == 'add') { /* * View */ -llxheader('', $langs->trans('AccountAccounting')); +$title = $langs->trans('AccountAccounting') ." - ". $langs->trans('Card'); +$helpurl = ''; +llxheader('', $title, $helpurl); $form = new Form($db); $htmlacc = new FormVentilation($db); @@ -184,7 +186,7 @@ if ($action == 'create') { print ''; // Account number - print ''; + print ''; print ''; // Label @@ -247,7 +249,7 @@ if ($action == 'create') { print '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
'; // Account number - print ''; + print ''; print ''; // Label @@ -299,7 +301,7 @@ if ($action == 'create') { print '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
'; // Account number - print ''; + print ''; print ''; print ''; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 14d91d85581..3cb9f407ce6 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -81,6 +81,9 @@ if ($action == 'update') { if (! dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { $error ++; } + if ($modelcsv==AccountancyExport::$EXPORT_TYPE_QUADRATUS || $modelcsv==AccountancyExport::$EXPORT_TYPE_CIEL) { + dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', 'txt', 'chaine', 0, '', $conf->entity); + } } else { $error ++; } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index b019872da6e..0173ac931cc 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -168,6 +168,18 @@ if ($action == 'setmanagezero') { } } +if ($action == 'setdisabledirectinput') { + $setdisabledirectinput = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); + if (! $res > 0) + $error ++; + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } +} + /* * View */ @@ -342,6 +354,20 @@ if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { } print ''; +$var = ! $var; +print ""; +print ''; +if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { + print ''; +} else { + print ''; +} +print ''; + print "
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '' . $object->account_number . '' . $linkback . '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print '
\n"; dol_fiche_end(); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 6211f5752b1..ff7f764ea31 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -47,8 +47,6 @@ class AccountancyCategory */ public function __construct($db) { $this->db = $db; - - return 1; } /** diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index ddc80e00571..8c7fedbfa5c 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -295,6 +295,8 @@ class AccountancyExport public function exportCiel(&$TData) { global $conf; + $this->end_line ="\r\n"; + $i = 1; $date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd foreach ( $TData as $data ) { @@ -333,6 +335,8 @@ class AccountancyExport public function exportQuadratus(&$TData) { global $conf; + $this->end_line ="\r\n"; + $date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy foreach ( $TData as $data ) { $code_compta = $data->numero_compte; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 5832d44cd52..0d863e064d4 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -95,7 +95,6 @@ class BookKeeping extends CommonObject */ public function __construct(DoliDB $db) { $this->db = $db; - return 1; } /** diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index fce70e56051..4df2c68243a 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -43,7 +43,7 @@ if ($user->societe_id > 0) accessforbidden(); if (! $user->rights->accounting->ventilation->read) accessforbidden(); - + // Filter $year = $_GET["year"]; if ($year == 0) { @@ -57,17 +57,17 @@ if ($year == 0) { // Validate History $action = GETPOST('action'); if ($action == 'validatehistory') { - + $error = 0; $db->begin(); - + if ($db->type == 'pgsql') { - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd"; - $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet"; + $sql1 .= " SET fk_code_ventilation = accnt.rowid"; $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; - $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; + $sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; - $sql1 .= " AND fd.fk_code_ventilation = 0"; + $sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0"; } else { $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; @@ -75,9 +75,9 @@ if ($action == 'validatehistory') { $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number"; $sql1 .= " AND fd.fk_code_ventilation = 0"; } - + dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG); - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -90,7 +90,7 @@ if ($action == 'validatehistory') { } elseif ($action == 'fixaccountancycode') { $error = 0; $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd"; $sql1 .= " SET fd.fk_code_ventilation = 0"; $sql1 .= ' WHERE fd.fk_code_ventilation NOT IN '; @@ -98,9 +98,9 @@ if ($action == 'validatehistory') { $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt'; $sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst'; $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; - + dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -113,15 +113,15 @@ if ($action == 'validatehistory') { } elseif ($action == 'cleanaccountancycode') { $error = 0; $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd"; $sql1 .= " SET fd.fk_code_ventilation = 0"; $sql1 .= " WHERE fd.fk_facture IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture as f"; $sql1 .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'"; $sql1 .= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "')"; - + dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -196,11 +196,10 @@ $sql .= " GROUP BY fd.fk_code_ventilation,aa.account_number,aa.label"; dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { - $i = 0; $num = $db->num_rows($resql); - - while ( $i < $num ) { - $row = $db->fetch_row($resql); + + while ( $row = $db->fetch_row($resql)) { + $var = ! $var; print '' . length_accountg($row[0]) . ''; print '' . $row[1] . ''; @@ -210,7 +209,6 @@ if ($resql) { print '' . price($row[13]) . ''; print '' . price($row[14]) . ''; print ''; - $i ++; } $db->free($resql); } else { @@ -245,10 +243,8 @@ $resql = $db->query($sql); if ($resql) { $i = 0; $num = $db->num_rows($resql); - - while ( $i < $num ) { - $row = $db->fetch_row($resql); - + + while ($row = $db->fetch_row($resql)) { print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; @@ -271,37 +267,34 @@ if (! empty($conf->margin->enabled)) { print '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . ''; } print '' . $langs->trans("Total") . ''; - - $sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Marge',"; + + $sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,"; for($i = 1; $i <= 12; $i ++) { $sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; } - $sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as 'Total'"; + $sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture"; $sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; $sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'"; - + if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; } - + dol_syslog('htdocs/accountancy/customer/index.php:: $sql=' . $sql); $resql = $db->query($sql); if ($resql) { - $i = 0; $num = $db->num_rows($resql); - - while ( $i < $num ) { - $row = $db->fetch_row($resql); - + + while ($row = $db->fetch_row($resql)) { + print '' . $row[0] . ''; for($i = 1; $i <= 12; $i ++) { print '' . price($row[$i]) . ''; } print '' . price($row[13]) . ''; print ''; - $i ++; } $db->free($resql); } else { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 167f558d830..0c1a4d1eb6b 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -185,7 +185,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " WHERE f.fk_statut > 0"; -$sql .= " AND fk_code_ventilation <= 0"; +$sql .= " AND l.fk_code_ventilation <= 0"; $sql .= " AND product_type <= 2"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; @@ -307,6 +307,7 @@ if ($result) { // Ref Invoice $facture_static->ref = $objp->facnumber; $facture_static->id = $objp->facid; + $facture_static->type = $objp->ftype; print '' . $facture_static->getNomUrl(1) . ''; // Ref Product $product_static->ref = $objp->product_ref; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 47bc9576a91..937b6a8fa36 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -166,7 +166,7 @@ if ($action == 'writebookkeeping') { $now = dol_now(); $error = 0; - foreach ($tabfac as $key => $val) + foreach ($tabfac as $key => $val) { $companystatic = new Societe($db); $invoicestatic = new FactureFournisseur($db); @@ -425,7 +425,7 @@ if ($action == 'export_csv') { 'action' => '' )); - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 || $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { print ''; } else { print ''; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 7a92d6649d3..24e1bfa81ea 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -443,7 +443,7 @@ if ($action == 'export_csv') { 'action' => '' )); - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 || $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { + if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { print ''; } else { print ''; diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 5e87985ce61..9dd5bd1e1d7 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -41,7 +41,7 @@ if ($user->societe_id > 0) accessforbidden(); if (! $user->rights->accounting->ventilation->read) accessforbidden(); - + // Filter $year = $_GET["year"]; if ($year == 0) { @@ -55,17 +55,17 @@ if ($year == 0) { // Validate History $action = GETPOST('action'); if ($action == 'validatehistory') { - + $error = 0; $db->begin(); - + if ($db->type == 'pgsql') { - $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; - $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det"; + $sql1 .= " SET fk_code_ventilation = accnt.rowid"; $sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; - $sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; + $sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS; $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number"; - $sql1 .= " AND fd.fk_code_ventilation = 0"; + $sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0"; } else { $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst"; $sql1 .= " SET fd.fk_code_ventilation = accnt.rowid"; @@ -73,7 +73,7 @@ if ($action == 'validatehistory') { $sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number"; $sql1 .= " AND fd.fk_code_ventilation = 0"; } - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -86,7 +86,7 @@ if ($action == 'validatehistory') { } elseif ($action == 'fixaccountancycode') { $error = 0; $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; $sql1 .= " SET fd.fk_code_ventilation = 0"; $sql1 .= ' WHERE fd.fk_code_ventilation NOT IN '; @@ -94,9 +94,9 @@ if ($action == 'validatehistory') { $sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt'; $sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst'; $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; - + dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -109,15 +109,15 @@ if ($action == 'validatehistory') { } elseif ($action == 'cleanaccountancycode') { $error = 0; $db->begin(); - + $sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd"; $sql1 .= " SET fd.fk_code_ventilation = 0"; $sql1 .= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $sql1 .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'"; $sql1 .= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "')"; - + dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); - + $resql1 = $db->query($sql1); if (! $resql1) { $error ++; @@ -154,35 +154,17 @@ $var = true; print ''; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +for($i = 1; $i <= 12; $i ++) { + print ''; +} print ''; -$sql = "SELECT IF(aa.account_number IS NULL, 'Non pointe', aa.account_number) AS 'code comptable',"; -$sql .= " IF(aa.label IS NULL, 'Non pointe', aa.label) AS 'Intitulé',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=1,ffd.total_ht,0)),2) AS 'Janvier',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=2,ffd.total_ht,0)),2) AS 'Fevrier',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=3,ffd.total_ht,0)),2) AS 'Mars',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=4,ffd.total_ht,0)),2) AS 'Avril',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=5,ffd.total_ht,0)),2) AS 'Mai',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=6,ffd.total_ht,0)),2) AS 'Juin',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=7,ffd.total_ht,0)),2) AS 'Juillet',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=8,ffd.total_ht,0)),2) AS 'Aout',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=9,ffd.total_ht,0)),2) AS 'Septembre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=10,ffd.total_ht,0)),2) AS 'Octobre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=11,ffd.total_ht,0)),2) AS 'Novembre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=12,ffd.total_ht,0)),2) AS 'Decembre',"; -$sql .= " ROUND(SUM(ffd.total_ht),2) as 'Total'"; +$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,"; +$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,"; +for($i = 1; $i <= 12; $i ++) { + $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; +} +$sql .= " ROUND(SUM(ffd.total_ht),2) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation"; @@ -194,35 +176,24 @@ if (! empty($conf->multicompany->enabled)) { $sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 1) . ")"; } -$sql .= " GROUP BY ffd.fk_code_ventilation"; +$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label"; dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); $resql = $db->query($sql); if ($resql) { - $i = 0; $num = $db->num_rows($resql); - - while ( $i < $num ) { - - $row = $db->fetch_row($resql); + + while ( $row = $db->fetch_row($resql)) { + $var = ! $var; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + for($i = 2; $i <= 12; $i ++) { + print ''; + } print ''; print ''; print ''; - $i ++; } $db->free($resql); } else { @@ -233,34 +204,16 @@ print "
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . length_accountg($row[0]) . '' . $row[1] . '' . price($row[2]) . '' . price($row[3]) . '' . price($row[4]) . '' . price($row[5]) . '' . price($row[6]) . '' . price($row[7]) . '' . price($row[8]) . '' . price($row[9]) . '' . price($row[10]) . '' . price($row[11]) . '' . price($row[12]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '
\n"; print "
\n"; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +for($i = 1; $i <= 12; $i ++) { + print ''; +} print ''; -$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS 'Total',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=1,ffd.total_ht,0)),2) AS 'Janvier',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=2,ffd.total_ht,0)),2) AS 'Fevrier',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=3,ffd.total_ht,0)),2) AS 'Mars',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=4,ffd.total_ht,0)),2) AS 'Avril',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=5,ffd.total_ht,0)),2) AS 'Mai',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=6,ffd.total_ht,0)),2) AS 'Juin',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=7,ffd.total_ht,0)),2) AS 'Juillet',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=8,ffd.total_ht,0)),2) AS 'Aout',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=9,ffd.total_ht,0)),2) AS 'Septembre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=10,ffd.total_ht,0)),2) AS 'Octobre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=11,ffd.total_ht,0)),2) AS 'Novembre',"; -$sql .= " ROUND(SUM(IF(MONTH(ff.datef)=12,ffd.total_ht,0)),2) AS 'Decembre',"; -$sql .= " ROUND(SUM(ffd.total_ht),2) as 'Total'"; +$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,"; +for($i = 1; $i <= 12; $i ++) { + $sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ","; +} +$sql .= " ROUND(SUM(ffd.total_ht),2) as total"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn"; $sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'"; @@ -274,31 +227,19 @@ if (! empty($conf->multicompany->enabled)) { dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql); $resql = $db->query($sql); if ($resql) { - $i = 0; $num = $db->num_rows($resql); - - while ( $i < $num ) { - $row = $db->fetch_row($resql); - + + while ( $row = $db->fetch_row($resql)) { + + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + for($i = 1; $i <= 12; $i ++) { + print ''; + } print ''; print ''; - - $i ++; } - + $db->free($resql); } else { print $db->lasterror(); // Show last sql error diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 77fa8022968..057d7ada946 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -77,7 +77,9 @@ if ($object->id > 0) $langs->load("companies"); - llxHeader("",$langs->trans("Agenda"),''); + $title=$langs->trans("Member") . " - " . $langs->trans("Agenda"); + $helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; + llxHeader("",$title,$helpurl); if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = member_prepare_head($object); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 347052f86be..ba1a06c9f17 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -717,8 +717,9 @@ if (empty($reshook)) $form = new Form($db); $formcompany = new FormCompany($db); +$title=$langs->trans("Member") . " - " . $langs->trans("Card"); $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; -llxHeader('',$langs->trans("Member"),$help_url); +llxHeader('',$title,$help_url); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 92331d2cc88..838ba49c6a9 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -557,7 +557,9 @@ $form = new Form($db); $now=dol_now(); -llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +$title=$langs->trans("Member") . " - " . $langs->trans("Subscriptions"); +$helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; +llxHeader("",$title,$helpurl); if ($rowid > 0) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 7604c4fe02c..5c950b06e13 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1580,7 +1580,7 @@ class Adherent extends CommonObject $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $link=''; $linkend=''; - if ($option == 'card') + if ($option == 'card' || $option == 'category') { $link = ''; } - if ($option == 'category') - { - $type = Categorie::TYPE_MEMBER; - $link = 'trans("Documents"); +$helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; +llxHeader("",$title,$helpurl); if ($id > 0) { diff --git a/htdocs/adherents/info.php b/htdocs/adherents/info.php index 36ed504dd73..53e9b7ee092 100644 --- a/htdocs/adherents/info.php +++ b/htdocs/adherents/info.php @@ -44,7 +44,9 @@ $result=restrictedArea($user,'adherent',$id); $form = new Form($db); -llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +$title=$langs->trans("Member") . " - " . $langs->trans("Info"); +$helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; +llxHeader("",$title,$helpurl); $object = new Adherent($db); $object->fetch($id); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 98e62d4210b..2297b155634 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -215,6 +215,7 @@ if ($search_ref) if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")"; else $sql.=" AND 1 = 2"; // Always wrong } +if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname); if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname); if ($search_login) $sql.= natural_search("d.login", $search_login); if ($search_email) $sql.= natural_search("d.email", $search_email); @@ -421,7 +422,7 @@ if ($resql) if (! empty($arrayfields['d.firstname']['checked'])) { print ''; + print ''; } if (! empty($arrayfields['d.lastname']['checked'])) @@ -611,6 +612,13 @@ if ($resql) print "\n"; + } + // Firstname + if (! empty($arrayfields['d.firstname']['checked'])) + { + print "\n"; } // Lastname if (! empty($arrayfields['d.lastname']['checked'])) @@ -618,13 +626,6 @@ if ($resql) print "\n"; - } - // Firstname - if (! empty($arrayfields['d.firstname']['checked'])) - { - print "\n"; } // Company if (! empty($arrayfields['d.company']['checked'])) diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index a895d6cfef8..9e6a20f6cb3 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -59,8 +59,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, /* * View */ - -llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'); +$title=$langs->trans("Member") . " - " . $langs->trans("Note"); +$helpurl="EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros"; +llxHeader("",$title,$helpurl); $form = new Form($db); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index cb8ac8a599a..989aa001131 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -172,7 +172,7 @@ if ($action == 'edit') // Edit print ''; print ''; - // Multilangual GUI + // Multilingual GUI $var=!$var; print ''; - - print ''."\n"; - print ''."\n"; - - // Value - print ''; - - print ''; - - print "\n"; - print "\n"; - $i++; - } } +if ($mode == 'searchkey') +{ + $langcode=GETPOST('langcode')?GETPOST('langcode'):$langs->defaultlang; + + $newlang=new Translate('',$conf); + $newlang->setDefaultLang($langcode); -print '
' . $langs->trans("Total") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . '' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $row[0] . '' . $row[1] . '' . price($row[2]) . '' . price($row[3]) . '' . price($row[4]) . '' . price($row[5]) . '' . price($row[6]) . '' . price($row[7]) . '' . price($row[8]) . '' . price($row[9]) . '' . price($row[10]) . '' . price($row[11]) . '' . price($row[12]) . '' . price($row[$i]) . '' . price($row[13]) . '
'; - print '"; print $memberstatic->getNomUrl(1); print ""; + print $obj->firstname; + print ""; print $obj->lastname; print ""; - print $obj->firstname; - print " 
'.$langs->trans("EnableMultilangInterface").''; print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1); @@ -186,7 +186,7 @@ if ($action == 'edit') // Edit show_theme(null,1); print '
'; - // Liste des zone de recherche permanantes supportees + // List of permanent supported search box if (! empty($searchform)) { print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 1a021996163..0e82681c686 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -48,11 +48,11 @@ if ($action == "set") $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int'); $account = new Account($db); - if($account->fetch($id)>0) { $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; + /* $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity); @@ -67,6 +67,7 @@ if ($action == "set") if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; + */ } else $error++; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index f3cfcff9807..ae32c073349 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -27,6 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +global $conf; + if (!$user->admin) accessforbidden(); $langs->load("admin"); @@ -40,34 +42,37 @@ $activeModules = array(); if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(constant('SYSLOG_HANDLERS')); -$dir = dol_buildpath('/core/modules/syslog/'); +$dirsyslogs = array_merge(array('/core/modules/syslog/'), $conf->modules_parts['syslog']); +foreach ($dirsyslogs as $reldir) { + $dir = dol_buildpath($reldir, 0); + $newdir = dol_osencode($dir); + if (is_dir($newdir)) { + $handle = opendir($newdir); -if (is_dir($dir)) -{ - $handle = opendir($dir); + if (is_resource($handle)) { + $var = true; - if (is_resource($handle)) - { - $var=true; + while (($file = readdir($handle)) !== false) { + if (substr($file, 0, 11) == 'mod_syslog_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { + $file = substr($file, 0, dol_strlen($file) - 4); - while (($file = readdir($handle))!==false) - { - if (substr($file, 0, 11) == 'mod_syslog_' && substr($file, dol_strlen($file)-3, 3) == 'php') - { - $file = substr($file, 0, dol_strlen($file)-4); + require_once $newdir . $file . '.php'; - require_once $dir.$file.'.php'; + $module = new $file; - $module = new $file; + // Show modules according to features level + if ($module->getVersion() == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + continue; + } + if ($module->getVersion() == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + continue; + } - // Show modules according to features level - if ($module->getVersion() == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->getVersion() == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - $syslogModules[] = $file; + $syslogModules[] = $file; + } } + closedir($handle); } - closedir($handle); } } diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index f5c5970e9b3..bf313be16c2 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -23,6 +23,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $langs->load("companies"); @@ -36,15 +37,52 @@ if (!$user->admin) accessforbidden(); $id=GETPOST('rowid','int'); $action=GETPOST('action','alpha'); + $langcode=GETPOST('langcode','alpha'); $transkey=GETPOST('transkey','alpha'); $transvalue=GETPOST('transvalue','alpha'); +$mode = GETPOST('mode')?GETPOST('mode'):'overwrite'; + +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='lang,transkey'; +if (! $sortorder) $sortorder='ASC'; + + /* * Actions */ +/* + * Actions + */ + +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +{ + $transkey=''; + $transvalue=''; + $toselect=''; + $search_array_options=array(); +} + if ($action == 'add' || (GETPOST('add') && $action != 'update')) { @@ -62,7 +100,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) } if ($transvalue == '') { - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors'); $error++; } if (! $error) @@ -113,127 +151,290 @@ $formadmin = new FormAdmin($db); $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; llxHeader('',$langs->trans("Setup"),$wikihelp); -print load_fiche_titre($langs->trans("TranslationSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("Translation"),'','title_setup'); print $langs->trans("TranslationDesc")."
\n"; print "
\n"; -print $langs->trans("CurrentUserLanguage").': '.$langs->defaultlang.'
'; -print '
'; - -print img_info().' '.$langs->trans("SomeTranslationAreUncomplete").'
'; -$urlwikitranslatordoc='http://wiki.dolibarr.org/index.php/Translator_documentation'; -print $langs->trans("SeeAlso").': '.$urlwikitranslatordoc.'
'; +$current_language_code=$langs->defaultlang; +$s=picto_from_langcode($current_language_code); +print $langs->trans("CurrentUserLanguage").': '.$s.' '.$current_language_code.'
'; print '
'; -print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("Value"))."
\n"; +$param='&mode='.$mode; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($optioncss != '') $param.='&optioncss='.$optioncss; +if ($langcode) $param.='&langcode='.urlencode($langcode); +if ($transkey) $param.='&transkey='.urlencode($transkey); +if ($transvalue) $param.='&transvalue='.urlencode($transvalue); -print '
'; print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; +if ($optioncss != '') print ''; print ''; -print ''; +print ''; +print ''; +print ''; +print ''; -print '
'; -print ''; -print ''; -print ''; -print ''; -if (! empty($conf->multicompany->enabled) && !$user->entity) print ''; -print ''; -print "\n"; +$head=translation_prepare_head(); +dol_fiche_head($head, $mode, '', 0, ''); -// Line to add new record -$var=false; -print "\n"; - -print ''."\n"; -print ''; -// Limit to superadmin -if (! empty($conf->multicompany->enabled) && !$user->entity) +if ($mode == 'overwrite') { - print ''; - print '\n"; -print ''; + //print load_fiche_titre($langs->trans("TranslationOverwriteKey"), '', '')."\n"; + print img_info().' '.$langs->trans("SomeTranslationAreUncomplete"); + $urlwikitranslatordoc='https://wiki.dolibarr.org/index.php/Translator_documentation'; + print ' ('.$langs->trans("SeeAlso").': '.$urlwikitranslatordoc.')
'; + print $langs->trans("TranslationOverwriteDesc",$langs->transnoentitiesnoconv("Language"),$langs->transnoentitiesnoconv("Key"),$langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n"; + print ' ('.$langs->trans("TranslationOverwriteDesc2").').'."
\n"; + print '
'; + + + print ''; + print ''; + print ''; + + print '
'.$langs->trans("Language").' (en_US, es_MX, ...)'.$langs->trans("Key").''.$langs->trans("Value").''.$langs->trans("Entity").'
'; -print $formadmin->select_language(GETPOST('langcode'),'langcode',0,null,1,0,0,'',1); -//print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - print ''; - print ''; -} -else -{ - print ''; - print ''; -} -print ''; -print "
'; + print ''; + print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("NewTranslationStringToShow"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); + if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); + print ''; + print "\n"; + + + // Line to add new record + $var=false; + print "\n"; + + print ''."\n"; + print ''; + // Limit to superadmin + if (! empty($conf->multicompany->enabled) && !$user->entity) + { + print ''; + print '\n"; + print ''; + + + // Show constants + $sql = "SELECT"; + $sql.= " rowid"; + $sql.= ", lang"; + $sql.= ", transkey"; + $sql.= ", transvalue"; + $sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; + $sql.= " WHERE 1 = 1"; + //$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; + //if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug + //else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits + //if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); + //$sql.= " ORDER BY entity, name ASC"; + $sql.= $db->order($sortfield, $sortorder); + + dol_syslog("translation::select from table", LOG_DEBUG); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + $var=false; + + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var=!$var; + + print "\n"; + + print ''; + + print ''."\n"; + print ''."\n"; + + // Value + print ''; + + print ''; + + print "\n"; + print "\n"; + $i++; + } + } + + + print '
'; + print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, null, 1, 0, 0, 'maxwidthonsmartphone', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + else + { + print ''; + print ''; + } + print ''; + print "
'.$obj->lang.''.$obj->transkey.''; + /*print ''; + print ''; + print ''; + print ''; + */ + print $obj->transvalue; + print ''; + print ''.img_delete().''; + print '
'; -// Show constants -$sql = "SELECT"; -$sql.= " rowid"; -$sql.= ", lang"; -$sql.= ", transkey"; -$sql.= ", transvalue"; -//$sql.= ", entity"; -$sql.= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; -$sql.= " WHERE 1 = 1"; -//$sql.= " AND entity IN (".$user->entity.",".$conf->entity.")"; -//if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug -//else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits -//if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name')); -//$sql.= " ORDER BY entity, name ASC"; -$sql.= " ORDER BY lang ASC, transkey ASC"; - -dol_syslog("translation::select from table", LOG_DEBUG); -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - $var=false; - - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var=!$var; - - print "\n"; - - print '
'.$obj->lang.''.$obj->transkey.''; - /*print ''; - print ''; - print ''; - print ''; - */ - print $obj->transvalue; - print ''; - print ''.img_delete().''; - print '
'; + $newlangfileonly=new Translate('',$conf); + $newlangfileonly->setDefaultLang($langcode); + + $recordtoshow=array(); + + $nbempty=0; + /*var_dump($langcode); + var_dump($transkey); + var_dump($transvalue);*/ + if (empty($langcode) || $langcode == '-1') $nbempty++; + if (empty($transkey)) $nbempty++; + if (empty($transvalue)) $nbempty++; + if ($action == 'search' && ($nbempty > 999)) // 999 to disable this + { + setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings'); + } + else + { + // Load all translations keys + foreach($conf->file->dol_document_root as $keydir => $searchdir) + { + // Directory of translation files + $dir_lang = $searchdir."/langs/".$langcode; + $dir_lang_osencoded=dol_osencode($dir_lang); + + $filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1); + + foreach($filearray as $file) + { + $tmpfile=preg_replace('/.lang/i', '', basename($file['name'])); + $newlang->load($tmpfile, 0, 0, '', 0); + $newlangfileonly->load($tmpfile, 0, 0, '', 1); + //print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records
'."\n"; + } + } + + // Now search into translation array + foreach($newlang->tab_translate as $key => $val) + { + if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue; + if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue; + $recordtoshow[$key]=$val; + } + } + + //print '
'; + $nbtotalofrecordswithoutfilters = count($newlang->tab_translate); + $nbtotalofrecords = count($recordtoshow); + $num = $limit + 1; + if (($offset + $num) > $nbtotalofrecords) $num = $limit; + + //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; + $title = $langs->trans("TranslationKeySearch"); + if ($nbtotalofrecords > 0) $title.=' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.')'; + print print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit)."\n"; + + print ''; + print ''; + print ''; + + print ''; + print ''; + print_liste_field_titre($langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).''; + print_liste_field_titre($langs->trans("Key"),$_SERVER["PHP_SELF"],'transkey','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CurrentTranslationString"),$_SERVER["PHP_SELF"],'transvalue','',$param,'',$sortfield,$sortorder); + if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],'entity,transkey','',$param,'',$sortfield,$sortorder); + print ''; + print "\n"; + + // Line to search new record + $var=false; + print "\n"; + + print ''."\n"; + print ''; + // Action column + print ''; + print ''; + + if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') ksort($recordtoshow); + if ($sortfield == 'transkey' && strtolower($sortorder) == 'desc') krsort($recordtoshow); + if ($sortfield == 'transvalue' && strtolower($sortorder) == 'asc') asort($recordtoshow); + if ($sortfield == 'transvalue' && strtolower($sortorder) == 'desc') arsort($recordtoshow); + + // Show result + $i=0; + $var=false; + foreach($recordtoshow as $key => $val) + { + $i++; + if ($i <= $offset) continue; + if ($i > ($offset + $limit)) break; + $var=!$var; + print ''."\n"; + } + + print '
'; + //print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1); + print $formadmin->select_language($langcode,'langcode', 0, null, 0, 0, 0, 'maxwidthonsmartphone', 1); + print ''; + print ''; + print ''; + print ''; + // Limit to superadmin + if (! empty($conf->multicompany->enabled) && !$user->entity) + { + print ''; + print ''; + } + else + { + print ''; + } + print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; + print '
'.$langcode.''.$key.''; + print dol_escape_htmltag($val); + print ''; + if ($val != $newlangfileonly->tab_translate[$key]) + { + $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]); + print $form->textwithpicto('', $htmltext, 1, 'warning'); + } + print '
'; + print ''; +} + +dol_fiche_end(); print "\n"; diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index 745ea723b49..75347427bda 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -62,9 +62,9 @@ $langs->load("main"); print '
\n"; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 25fb000a594..38ff45d043d 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -152,6 +152,7 @@ elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCateg elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort"); +elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -207,7 +208,7 @@ if ($action == 'edit') $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, 3, 80); $doleditor->Create(); print ''; - + print ''; print ''; } diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 09fda82223b..4411061e0c0 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -115,6 +115,13 @@ if ($id > 0 && $removeelem > 0) $result = $tmpobject->fetch($removeelem); $elementtype = 'account'; } + else if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer) + { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $tmpobject = new Project($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'project'; + } $result=$object->del_type($tmpobject,$elementtype); if ($result < 0) dol_print_error('',$object->error); @@ -169,7 +176,8 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' $form = new Form($db); $formother = new FormOther($db); -llxHeader("","",$langs->trans("Categories")); +$helpurl=''; +llxHeader("",$langs->trans("Categories"),$helpurl); if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoryShort"); elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoryShort"); @@ -177,6 +185,7 @@ elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCateg elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoryShort"); elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactCategoriesShort"); elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesShort"); +elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesShort"); else $title=$langs->trans("Category"); $head = categories_prepare_head($object,$type); @@ -359,6 +368,7 @@ if ($object->type == Categorie::TYPE_PRODUCT) if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -409,6 +419,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER) if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -463,6 +474,7 @@ if($object->type == Categorie::TYPE_CUSTOMER) if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -518,6 +530,7 @@ if ($object->type == Categorie::TYPE_MEMBER) if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -570,6 +583,7 @@ if($object->type == Categorie::TYPE_CONTACT) if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_CONTACT) $permission=$user->rights->societe->creer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -625,6 +639,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT) if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; if ($permission) { print ""; @@ -642,6 +657,61 @@ if ($object->type == Categorie::TYPE_ACCOUNT) } } +// List of Project +if ($object->type == Categorie::TYPE_PROJECT) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + + $projects = $object->getObjectsInCateg("project"); + if ($projects < 0) + { + dol_print_error($db, $object->error, $object->errors); + } + else + { + print "
"; + print "\n"; + print '\n"; + + if (count($projects) > 0) + { + $var=true; + foreach ($projects as $key => $project) + { + $var=!$var; + print "\t\n"; + print '\n"; + print '\n"; + print '\n"; + // Link to delete from category + print '\n"; + } + } + else + { + print ''; + } + print "
'.$langs->trans("Project")."
'; + print $project->getNomUrl(1,0); + print "'.$project->ref."'.$project->title."'; + $typeid=$object->type; + $permission=0; + if ($typeid == Categorie::TYPE_PRODUCT) $permission=($user->rights->produit->creer || $user->rights->service->creer); + if ($typeid == Categorie::TYPE_SUPPLIER) $permission=$user->rights->societe->creer; + if ($typeid == Categorie::TYPE_CUSTOMER) $permission=$user->rights->societe->creer; + if ($typeid == Categorie::TYPE_MEMBER) $permission=$user->rights->adherent->creer; + if ($typeid == Categorie::TYPE_ACCOUNT) $permission=$user->rights->banque->configurer; + if ($typeid == Categorie::TYPE_PROJECT) $permission=$user->rights->projet->creer; + if ($permission) + { + print ""; + print img_delete($langs->trans("DeleteFromCat")).' '; + print $langs->trans("DeleteFromCat").""; + } + print "
'.$langs->trans("ThisCategoryHasNoProject").'
\n"; + } +} + llxFooter(); $db->close(); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a5016de7ec4..c4739845042 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -513,7 +513,7 @@ class ActionComm extends CommonObject $sql.= " a.fk_contact, a.percent as percentage,"; $sql.= " a.fk_element, a.elementtype,"; $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; - $sql.= " c.id as type_id, c.code as type_code, c.libelle,"; + $sql.= " c.id as type_id, c.code as type_code, c.libelle, c.color as type_color,"; $sql.= " s.nom as socname,"; $sql.= " u.firstname, u.lastname as lastname"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a "; @@ -541,6 +541,7 @@ class ActionComm extends CommonObject // Properties of parent table llx_c_actioncomm (will be deprecated in future) $this->type_id = $obj->type_id; $this->type_code = $obj->type_code; + $this->type_color = $obj->type_color; $transcode=$langs->trans("Action".$obj->type_code); $type_libelle=($transcode!="Action".$obj->type_code?$transcode:$obj->libelle); $this->type = $type_libelle; @@ -1109,7 +1110,11 @@ class ActionComm extends CommonObject if (! empty($this->location)) $tooltip .= '
' . $langs->trans('Location') . ': ' . $this->location; - $linkclose = ' class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">'; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) + $linkclose = ' style="background-color:#'.$this->type_color.'" class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">'; + else + $linkclose = ' class="'.$classname.' classfortooltip" title="'.dol_escape_htmltag($tooltip, 1).'">'; + if (! is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5306300e7b1..f70b8d171a1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -440,7 +440,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; -$sql.= ' ca.code as type_code, ca.libelle as type_label'; +$sql.= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; // We must filter on resource table @@ -531,6 +531,8 @@ if ($resql) $event->type_code=$obj->type_code; $event->type_label=$obj->type_label; + $event->type_color=$obj->type_color; + $event->libelle=$obj->label; $event->percentage=$obj->percent; $event->authorid=$obj->fk_user_author; // user id of creator diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index a205ff54d1a..548cd3bb7e4 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -71,7 +71,7 @@ if (! empty($conf->supplier_proposal->enabled)) $supplierproposalstatic=new Supp if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db); if (! empty($conf->fournisseur->enabled)) $supplierorderstatic=new CommandeFournisseur($db); -llxHeader(); +llxHeader("",$langs->trans("CommercialArea")); print load_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png'); @@ -118,7 +118,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ':'; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 298ceb886b9..6a7ae2cefbe 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -79,6 +79,7 @@ class Mailing extends CommonObject $this->statuts[2] = 'MailingStatusSentPartialy'; $this->statuts[3] = 'MailingStatusSentCompletely'; + $this->statut_dest[0] = 'MailingStatusNotSent'; $this->statut_dest[-1] = 'MailingStatusError'; $this->statut_dest[1] = 'MailingStatusSent'; $this->statut_dest[2] = 'MailingStatusRead'; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 66474afea8e..7542782f6e7 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -45,6 +45,19 @@ $sall=GETPOST("sall","alpha"); $sref=GETPOST("sref","alpha"); $filteremail=GETPOST('filteremail','alpha'); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('mailinglist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('mailing'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array( + 'm.titre'=>'Ref', +); + /* @@ -107,6 +120,7 @@ if ($result) if (! $filteremail) print_liste_field_titre($langs->trans("DateLastSend"),$_SERVER["PHP_SELF"],"m.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); else print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],($filteremail?"mc.statut":"m.statut"),$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre('', $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; print ''; @@ -120,8 +134,11 @@ if ($result) print ' '; if (! $filteremail) print ' '; print ' '; - print ''; - print ""; + print ' '; + print ''; + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + print ''; print "\n"; $var=True; @@ -172,6 +189,7 @@ if ($result) print $email->LibStatut($obj->statut,5); } print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d5d41dad0a2..82223887b91 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -279,7 +279,7 @@ if (empty($reshook)) if ($socid < 1) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); - + $action = 'create'; $error ++; } @@ -345,7 +345,7 @@ if (empty($reshook)) $object->origin = GETPOST('origin'); $object->origin_id = GETPOST('originid'); - + // Multicurrency if (!empty($conf->multicurrency->enabled)) { @@ -718,7 +718,7 @@ if (empty($reshook)) $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); if (empty($tva_tx)) $tva_npr=0; - + $pu_ht = $prod->price; $pu_ttc = $prod->price_ttc; $price_min = $prod->price_min; @@ -932,7 +932,7 @@ if (empty($reshook)) // Add buying price $fournprice = price2num(GETPOST('fournprice') ? GETPOST('fournprice') : ''); - $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value + $buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value $date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear')); $date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear')); @@ -1082,7 +1082,7 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->propal->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } // bank account @@ -1167,12 +1167,12 @@ if (empty($reshook)) } } } - + // Actions to build doc $upload_dir = $conf->propal->dir_output; $permissioncreate=$user->rights->propal->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - + } @@ -1266,6 +1266,8 @@ if ($action == 'create') if ($origin != 'project' && $originid) { print ''; print ''; + } elseif ($origin == 'project' && !empty($projectid)) { + print ''; } dol_fiche_head(); @@ -1432,11 +1434,11 @@ if ($action == 'create') print ''; print ''.fieldLabel('Currency','multicurrency_code').''; print ''; - $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)); + $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)); print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0); print ''; } - + // Public note print ''; print '' . $langs->trans('NotePublic') . ''; @@ -1934,7 +1936,7 @@ if ($action == 'create') $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print ''; - + // Multicurrency rate print ''; print ''; @@ -2053,7 +2055,7 @@ if ($action == 'create') print '' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . ''; // Margin Infos - if (! empty($conf->margin->enabled)) + if (! empty($conf->margin->enabled)) { $rowspan=4; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) $rowspan++; @@ -2087,25 +2089,25 @@ if ($action == 'create') print '' . $langs->trans('AmountTTC') . ''; print '' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . ''; print ''; - + if (!empty($conf->multicurrency->enabled)) { // Multicurrency Amount HT print '' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . ''; print '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; - + // Multicurrency Amount VAT print '' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . ''; print '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; print ''; - + // Multicurrency Amount TTC print '' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . ''; print '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . ''; - print ''; + print ''; } - + // Statut print '' . $langs->trans('Status') . '' . $object->getLibStatut(4) . ''; @@ -2394,7 +2396,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'pro'.$object->id); - } + } $formmail->withfrom = 1; $liste = array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4ba01b8cd31..9c0c0c6a6f9 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -738,30 +738,37 @@ if ($resql) { $obj = $db->fetch_object($resql); $var=!$var; + + $objectstatic->id=$obj->rowid; + $objectstatic->ref=$obj->ref; + print ''; if (! empty($arrayfields['p.ref']['checked'])) { print ''; - $objectstatic->id=$obj->rowid; - $objectstatic->ref=$obj->ref; - print ''; // Picto + Ref print ''; // Warning - print ''; } - print ''; // Other picto tool print '"; - + if (!empty($conf->multicurrency->enabled)) { print ''; print '"; - print '"; + print '"; } } else @@ -1722,7 +1747,7 @@ if ($action == 'create' && $user->rights->commande->creer) print '     '; print ''; print ''; - + print ''; // Show origin lines @@ -1993,7 +2018,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; } - + // Relative and absolute discounts if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final @@ -2178,7 +2203,7 @@ if ($action == 'create' && $user->rights->commande->creer) $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print ''; - + // Multicurrency rate print ''; print ''; - } - + } + // TODO How record was recorded OrderMode (llx_c_input_method) // Project @@ -2360,16 +2385,16 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; print ''; - + // Multicurrency Amount VAT print ''; print ''; print ''; - + // Multicurrency Amount TTC print ''; print ''; - print ''; + print ''; } // Statut @@ -2488,7 +2513,7 @@ if ($action == 'create' && $user->rights->commande->creer) } // Create contract - if ($conf->contrat->enabled && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_ACCEPTED)) { + if ($conf->contrat->enabled && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_ACCEPTED || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); if ($user->rights->contrat->creer) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index cc4a156746f..5625b153ab1 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -95,11 +95,11 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield='c.ref'; if (! $sortorder) $sortorder='DESC'; +$viewstatut=GETPOST('viewstatut'); + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $contextpage='orderlist'; -$viewstatut=GETPOST('viewstatut'); - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('orderlist')); $extrafields = new ExtraFields($db); @@ -594,7 +594,7 @@ if ($resql) if (! empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'],$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'],$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'],$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder); - if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'],$_SERVER["PHP_SELF"],'c.tva','',$param, 'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'],$_SERVER["PHP_SELF"],'c.total_ttc','',$param, 'align="right"',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 3eb4764bb11..8adbfb1fcb5 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -52,6 +52,7 @@ $langs->load("salaries"); $langs->load("loan"); $langs->load("donations"); $langs->load("trips"); +$langs->load("members"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); $ref = GETPOST('ref','alpha'); @@ -177,8 +178,9 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->m /* * View */ - -llxHeader('',$langs->trans("FinancialAccount").'-'.$langs->trans("Transactions")); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("Transactions"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $societestatic=new Societe($db); $userstatic=new User($db); @@ -366,16 +368,11 @@ if ($id > 0 || ! empty($ref)) { if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - if (empty($conf->accounting->enabled)) - { - if ($user->rights->banque->modifier) { - print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; - } - } else { - print ''.$langs->trans("AddBankRecord").''; - } + if ($user->rights->banque->modifier) { + print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } } else { print ''.$langs->trans("AddBankRecord").''; } diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index f756d50ad2a..5f0dbfd10ac 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -53,8 +53,9 @@ else $year_end=$year_start+2; } - -llxHeader(); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("IOMonthlyReporting"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $form = new Form($db); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d4de4e5efb1..5f075ebf821 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -249,7 +249,9 @@ if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation( $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -llxHeader(); +$title = $langs->trans("FinancialAccount") . " - " . $langs->trans("Card"); +$helpurl = ""; +llxHeader("",$title,$helpurl); // Creation @@ -507,7 +509,11 @@ if ($action == 'create') dol_fiche_end(); - print '
'; + print '
'; + print ''; + print '     '; + print ''; + print '
'; print ''; } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 7320ce85f91..a014bdc5d60 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -139,8 +139,9 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes') { /* * View */ - -llxHeader(); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("Documents"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $form = new Form($db); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 0764c87f5ab..6f9de0a5aac 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -53,7 +53,9 @@ $error=0; * View */ -llxHeader(); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("Graph"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $form = new Form($db); diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index f6709c4d1c5..0d307115ed9 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -320,7 +320,7 @@ if ($result) print ''; } else if ($links[$key]['type']=='sc') { - print ''; + print ''; print img_object($langs->trans('ShowSocialContribution'),'bill').' '; print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:''); print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 7a7941da64d..ff50b3e66e5 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -81,7 +81,9 @@ $pagenext = $page + 1; * View */ -llxHeader(); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("AccountStatements"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $form = new Form($db); $societestatic=new Societe($db); @@ -469,7 +471,7 @@ else $newline=0; } elseif ($links[$key]['type']=='sc') { - print ''; + print ''; print img_object($langs->trans('ShowBill'),'bill').' '; print $langs->trans("SocialContribution"); print ''; diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 8860fa7c4ab..33e98f304c8 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry @@ -42,11 +42,12 @@ $langs->load("margins"); if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'banque'); +$search_ref=GETPOST('search_ref','int'); $description=GETPOST("description",'alpha'); $debit=GETPOST("debit",'alpha'); $credit=GETPOST("credit",'alpha'); $type=GETPOST("type",'alpha'); -$account=GETPOST("account",'alpha'); +$account=GETPOST("account",'int'); $bid=GETPOST("bid","int"); $search_dt_start = dol_mktime(0, 0, 0, GETPOST('search_start_dtmonth', 'int'), GETPOST('search_start_dtday', 'int'), GETPOST('search_start_dtyear', 'int')); $search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPOST('search_end_dtday', 'int'), GETPOST('search_end_dtyear', 'int')); @@ -64,28 +65,12 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder='DESC'; if (! $sortfield) $sortfield='b.dateo'; -$param=''; -if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; -if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; -if (!empty($description)) $param.='&description='.$description; -if (!empty($type)) $param.='&type='.$type; -if (!empty($debit)) $param.='&debit='.$debit; -if (!empty($credit)) $param.='&credit='.$credit; -if (!empty($account)) $param.='&account='.$account; -if (!empty($bid)) $param.='&bid='.$bid; -if (dol_strlen($search_dt_start) > 0) - $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int'); -if (dol_strlen($search_dt_end) > 0) - $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int'); -if (GETPOST("req_nb")) $param.='&req_nb='.urlencode(GETPOST("req_nb")); -if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); - /* * Actions */ -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.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $description=""; $type=""; @@ -93,6 +78,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $credit=""; $account=""; $bid=""; + $search_ref=""; $search_req_nb=''; $search_thirdparty=''; $thirdparty=''; @@ -127,29 +113,15 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid"; $sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; -if ($search_req_nb) -{ - $sql.= " AND b.num_chq LIKE '%".$db->escape($search_req_nb)."%'"; -} -if ($search_thirdparty) -{ - $sql.=" AND s.nom LIKE '%".$db->escape($search_thirdparty)."%'"; -} -if ($bid) -{ - $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid; -} -if (! empty($type)) -{ - $sql.= " AND b.fk_type = '".$db->escape($type)."' "; -} +if ($search_ref) $sql.=natural_search("b.rowid", $search_ref); +if ($account > 0) $sql.=" AND b.fk_account = ".$account; +if ($search_req_nb) $sql.= " AND b.num_chq LIKE '%".$db->escape($search_req_nb)."%'"; +if ($search_thirdparty) $sql.=" AND s.nom LIKE '%".$db->escape($search_thirdparty)."%'"; +if ($bid) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid; +if (! empty($type)) $sql.= " AND b.fk_type = '".$db->escape($type)."' "; // Search period criteria -if (dol_strlen($search_dt_start)>0) { - $sql .= " AND b.dateo >= '" . $db->idate($search_dt_start) . "'"; -} -if (dol_strlen($search_dt_end)>0) { - $sql .= " AND b.dateo <= '" . $db->idate($search_dt_end) . "'"; -} +if (dol_strlen($search_dt_start)>0) $sql .= " AND b.dateo >= '" . $db->idate($search_dt_start) . "'"; +if (dol_strlen($search_dt_end)>0) $sql .= " AND b.dateo <= '" . $db->idate($search_dt_end) . "'"; // Search criteria amount $debit = price2num(str_replace('-','',$debit)); $credit = price2num(str_replace('-','',$credit)); @@ -174,6 +146,23 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; + $param=''; + if (!empty($search_ref)) $param.='&search_ref='.$search_ref; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (!empty($description)) $param.='&description='.$description; + if (!empty($type)) $param.='&type='.$type; + if (!empty($debit)) $param.='&debit='.$debit; + if (!empty($credit)) $param.='&credit='.$credit; + if (!empty($account)) $param.='&account='.$account; + if (!empty($bid)) $param.='&bid='.$bid; + if (dol_strlen($search_dt_start) > 0) + $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int'); + if (dol_strlen($search_dt_end) > 0) + $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int'); + if (GETPOST("req_nb")) $param.='&req_nb='.urlencode(GETPOST("req_nb")); + if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty")); + print '
'."\n"; if ($optioncss != '') print ''; print ''; @@ -199,10 +188,11 @@ if ($resql) $moreforfilter = ''; $moreforfilter.='
'; - $moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('DateStart') . ' '; - $moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1); + $moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : '; + $moreforfilter .= '
'.$langs->trans('DateStart') . ' '; + $moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1).'
'; $moreforfilter .= ' - '; - $moreforfilter .= $langs->trans('DateEnd') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1); + $moreforfilter .= '
'.$langs->trans('DateEnd') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1).'
'; $moreforfilter .= '
'; if ($moreforfilter) @@ -221,14 +211,16 @@ if ($resql) print_liste_field_titre($langs->trans("Numero"),$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Description"),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],'bu.label','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Debit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Credit"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Account"),$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Debit"),$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Credit"),$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Account"),$_SERVER['PHP_SELF'],'ba.ref','',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; print '
'; - print ''; + print ''; print ''; print ''; print ''; - print ''; + print ''; print '\n"; print "\n"; -print ''; -print ''; +print ''; +print ''; print "
'; print $objectstatic->getNomUrl(1); print ''; - if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + $warnornote=''; + if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); if (! empty($obj->note_private)) { - print ' '; - print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; - print ''; + $warnornote.=($warnornote?' ':''); + $warnornote.= ''; + $warnornote.= ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + $warnornote.= ''; + } + if ($warnornote) + { + print ''; + print $warnornote; + print ''; $filename=dol_sanitizeFileName($obj->ref); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index a5c0a89f29d..4ea377a4487 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -100,8 +100,8 @@ if ($socid > 0) $head = societe_prepare_head($object); - - + + print '
'; print ''; print ''; @@ -110,9 +110,9 @@ if ($socid > 0) dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"),0,'company'); dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); - + print '
'; - + print '
'; print ''; @@ -138,9 +138,9 @@ if ($socid > 0) print "
"; print '
'; - + dol_fiche_end(); - + print '
'; print ''; if (! empty($backtopage)) @@ -161,7 +161,8 @@ if ($socid > 0) $sql = "SELECT rc.rowid, rc.remise_client as remise_percent, rc.note, rc.datec as dc,"; $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE rc.fk_soc =". $object->id; + $sql.= " WHERE rc.fk_soc = " . $object->id; + $sql.= " AND rc.entity = " . $conf->entity; $sql.= " AND u.rowid = rc.fk_user_author"; $sql.= " ORDER BY rc.datec DESC"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 0b9d85dba49..23a4cd67d37 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -248,7 +248,8 @@ if ($socid > 0) $remise_all=$remise_user=0; $sql = "SELECT SUM(rc.amount_ht) as amount, rc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; - $sql.= " WHERE rc.fk_soc =". $object->id; + $sql.= " WHERE rc.fk_soc = " . $object->id; + $sql.= " AND rc.entity = " . $conf->entity; $sql.= " AND (fk_facture_line IS NULL AND fk_facture IS NULL)"; $sql.= " GROUP BY rc.fk_user"; $resql=$db->query($sql); @@ -327,7 +328,8 @@ if ($socid > 0) $sql.= " fa.facnumber as ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fa ON rc.fk_facture_source = fa.rowid"; - $sql.= " WHERE rc.fk_soc =". $object->id; + $sql.= " WHERE rc.fk_soc = " . $object->id; + $sql.= " AND rc.entity = " . $conf->entity; $sql.= " AND u.rowid = rc.fk_user"; $sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)"; $sql.= " ORDER BY rc.datec DESC"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f43bd27505a..8b471fdcfe2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -262,14 +262,14 @@ if (empty($reshook)) $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); - + // Fill array 'array_options' with data from add form if (! $error) { $ret = $extrafields->setOptionalsFromPost($extralabels, $object); if ($ret < 0) $error++; } - + // If creation from another object of another module (Example: origin=propal, originid=1) if (! empty($origin) && ! empty($originid)) { @@ -376,13 +376,38 @@ if (empty($reshook)) $error++; } - // Hooks + // Now we create same links to contact than the ones found on origin object + if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + { + $originforcontact = $object->origin; + $originidforcontact = $object->origin_id; + if ($originforcontact == 'shipping') // shipment and order share the same contacts. If creating from shipment we take data of order + { + $originforcontact=$srcobject->origin; + $originidforcontact=$srcobject->origin_id; + } + $sqlcontact = "SELECT code, fk_socpeople FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sqlcontact.= " WHERE element_id = ".$originidforcontact." AND ec.fk_c_type_contact = ctc.rowid AND ctc.element = '".$originforcontact."'"; + + $resqlcontact = $db->query($sqlcontact); + if ($resqlcontact) + { + while($objcontact = $db->fetch_object($resqlcontact)) + { + //print $objcontact->code.'-'.$objcontact->fk_socpeople."\n"; + $object->add_contact($objcontact->fk_socpeople, $objcontact->code); + } + } + else dol_print_error($resqlcontact); + } + + // Hooks $parameters = array('objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) $error++; - + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -450,12 +475,12 @@ if (empty($reshook)) else if ($action == 'classifyunbilled' && $user->rights->commande->creer) { $ret=$object->classifyUnBilled(); - + if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - + // Positionne ref commande client else if ($action == 'set_ref_client' && $user->rights->commande->creer) { $object->set_ref_client($user, GETPOST('ref_client')); @@ -500,7 +525,7 @@ if (empty($reshook)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - + // Multicurrency Code else if ($action == 'setmulticurrencycode' && $user->rights->commande->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); @@ -508,9 +533,9 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } - + else if ($action == 'setavailability' && $user->rights->commande->creer) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) @@ -1309,7 +1334,7 @@ if ($action == 'create' && $user->rights->commande->creer) $remise_absolue = 0; $currency_code = $conf->currency; - + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; @@ -1380,7 +1405,7 @@ if ($action == 'create' && $user->rights->commande->creer) if (!empty($conf->multicurrency->enabled)) { if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; - if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; + if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } $note_private = $object->getDefaultCreateValueFor('note_private', (! empty($objectsrc->note_private) ? $objectsrc->note_private : null)); @@ -1403,7 +1428,7 @@ if ($action == 'create' && $user->rights->commande->creer) $remise_absolue = 0; $dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:''; $projectid = 0; - + if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; $note_private = $object->getDefaultCreateValueFor('note_private'); @@ -1671,12 +1696,12 @@ if ($action == 'create' && $user->rights->commande->creer) } print '
' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . "
' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . '
' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . "
' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . "
' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . "
'; @@ -2244,8 +2269,8 @@ if ($action == 'create' && $user->rights->commande->creer) print ' / '; print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
 '; + print ''; + print '  '; @@ -246,7 +238,9 @@ if ($resql) print ''; print ''; print ''; + $form->select_comptes($account,'account',0,'',1); + print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index e9596149e4f..2b3593cd5bd 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -55,7 +55,9 @@ $page=isset($_GET["page"])?$_GET["page"]:0; * View */ -llxHeader(); +$title = $langs->trans("FinancialAccount").' - '.$langs->trans("PlannedTransactions"); +$helpurl = ""; +llxHeader('',$title,$helpurl); $societestatic = new Societe($db); $facturestatic=new Facture($db); diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 78950923b34..abb06d17d76 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -179,8 +179,8 @@ print ""; $form->select_date((! empty($dateo)?$dateo:''),'','','','','add'); print "
"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 3f794491566..3b74833f23a 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("compta"); $langs->load("bills"); @@ -45,6 +46,8 @@ $year=GETPOST("year",'int'); $filtre=GETPOST("filtre",'alpha'); if (! $year && $mode != 'sconly') { $year=date("Y", time()); } +$search_account = GETPOST('search_account','int'); + $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -65,6 +68,7 @@ $tva_static = new Tva($db); $socialcontrib=new ChargeSociales($db); $payment_sc_static=new PaymentSocialContribution($db); $sal_static = new PaymentSalary($db); +$accountstatic = new Account($db); llxHeader('',$langs->trans("SpecialExpensesArea")); @@ -122,17 +126,21 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $sql = "SELECT c.id, c.libelle as lib,"; $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; - $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment,"; - $sql.= " pct.code as payment_code"; + $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,"; + $sql.= " pct.code as payment_code,"; + $sql.= " ba.rowid as bid, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; if ($year > 0) @@ -189,6 +197,20 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; print $obj->num_payment.''; + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + if ($obj->fk_bank > 0) + { + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id=$obj->bid; + $accountstatic->label=$obj->blabel; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print ''; + } // Paid print ''; if ($obj->totalpaye) print price($obj->totalpaye); @@ -205,6 +227,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ' '; print ' '; print ' '; + if (! empty($conf->banque->enabled)) print ''; print ''.price($totalpaye).""; print ""; } @@ -280,8 +303,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) } print ''.$langs->trans("Total").''; print ''.price($total).''; - print ' '; - print ' '; + print ' '; print ''.price($total).""; print ""; @@ -349,7 +371,6 @@ while($j<$numlt) print ''; print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); @@ -367,8 +388,6 @@ while($j<$numlt) print "".$obj->label."\n"; - print ''.price($obj->amount).""; - // Ref payment $tva_static->id=$obj->rowid; $tva_static->ref=$obj->rowid; @@ -380,10 +399,7 @@ while($j<$numlt) $i++; } - print ''.$langs->trans("Total").''; - print ''.price($total).""; - print ' '; - print ' '; + print ''.$langs->trans("Total").''; print ''.price($total).""; print ""; @@ -431,7 +447,6 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print ''; print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); @@ -450,8 +465,6 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print "".$obj->label."\n"; - print ''.($obj->salary?price($obj->salary):'').""; - // Ref payment $sal_static->id=$obj->rowid; $sal_static->ref=$obj->rowid; @@ -463,10 +476,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) $i++; } - print ''.$langs->trans("Total").''; - print ''; // A total here has no sense - print ' '; - print ' '; + print ''.$langs->trans("Total").''; print ''.price($total).""; print ""; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index eb1a78c8732..4a72b629df5 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -282,9 +282,9 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } - + else if ($action == 'setinvoicedate' && $user->rights->facture->creer) { $object->fetch($id); @@ -312,7 +312,7 @@ if (empty($reshook)) $result = $object->update($user); if ($result < 0) dol_print_error($db, $object->error); } - + else if ($action == 'setconditions' && $user->rights->facture->creer) { $object->fetch($id); @@ -705,7 +705,7 @@ if (empty($reshook)) } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - + if (! $error) { // This is a replacement invoice $result = $object->fetch($_POST['fac_replacement']); @@ -758,7 +758,7 @@ if (empty($reshook)) } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - + if (! $error) { $object->socid = GETPOST('socid','int'); @@ -780,7 +780,7 @@ if (empty($reshook)) $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); - + // Proprietes particulieres a facture avoir $object->fk_facture_source = $sourceinvoice > 0 ? $sourceinvoice : ''; $object->type = Facture::TYPE_CREDIT_NOTE; @@ -867,7 +867,7 @@ if (empty($reshook)) } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - + if (! $error) { $object->socid = GETPOST('socid','int'); @@ -891,7 +891,7 @@ if (empty($reshook)) $object->location_incoterms = GETPOST('location_incoterms', 'alpha'); $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); - + // Source facture $object->fac_rec = GETPOST('fac_rec'); @@ -917,7 +917,7 @@ if (empty($reshook)) } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - + if (! $error) { // Si facture standard @@ -1176,7 +1176,32 @@ if (empty($reshook)) $error ++; } } - + + // Now we create same links to contact than the ones found on origin object + if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) + { + $originforcontact = $object->origin; + $originidforcontact = $object->origin_id; + if ($originforcontact == 'shipping') // shipment and order share the same contacts. If creating from shipment we take data of order + { + $originforcontact=$srcobject->origin; + $originidforcontact=$srcobject->origin_id; + } + $sqlcontact = "SELECT code, fk_socpeople FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sqlcontact.= " WHERE element_id = ".$originidforcontact." AND ec.fk_c_type_contact = ctc.rowid AND ctc.element = '".$originforcontact."'"; + + $resqlcontact = $db->query($sqlcontact); + if ($resqlcontact) + { + while($objcontact = $db->fetch_object($resqlcontact)) + { + //print $objcontact->code.'-'.$objcontact->fk_socpeople."\n"; + $object->add_contact($objcontact->fk_socpeople, $objcontact->code); + } + } + else dol_print_error($resqlcontact); + } + // Hooks $parameters = array('objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been @@ -1186,7 +1211,7 @@ if (empty($reshook)) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $error++; } - + } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -1218,7 +1243,7 @@ if (empty($reshook)) } $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); - + if (!($_POST['situations'] > 0)) { $error++; $mesg = '
' . $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation")) . '
'; @@ -1233,8 +1258,8 @@ if (empty($reshook)) { $object->origin = $origin; $object->origin_id = $originid; - - foreach ($object->lines as &$line) + + foreach ($object->lines as &$line) { $line->origin = $object->origin; $line->origin_id = $line->id; @@ -1580,7 +1605,7 @@ if (empty($reshook)) $pu_ht = GETPOST('price_ht'); $vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); $qty = GETPOST('qty'); - + // Define info_bits $info_bits = 0; if (preg_match('/\*/', $vat_rate)) @@ -1765,7 +1790,7 @@ if (empty($reshook)) $upload_dir = $conf->facture->dir_output; $permissioncreate=$user->rights->facture->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - + if ($action == 'update_extras') { // Fill array 'array_options' with data from add form @@ -1855,7 +1880,9 @@ if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $now = dol_now(); -llxHeader('', $langs->trans('InvoiceCustomer'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Card'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); // Mode creation @@ -1872,7 +1899,7 @@ if ($action == 'create') $res = $soc->fetch($socid); $currency_code = $conf->currency; - + // Load objectsrc $remise_absolue = 0; @@ -1944,9 +1971,9 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled)) { if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; - if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; + if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } - + // Replicate extrafields $objectsrc->fetch_optionals($originid); $object->array_options = $objectsrc->array_options; @@ -1960,7 +1987,7 @@ if ($action == 'create') $remise_percent = $soc->remise_percent; $remise_absolue = 0; $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) - + if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; } @@ -1986,7 +2013,7 @@ if ($action == 'create') } print info_admin($text, 0, 0, 0).'
'; } - + print ''; print ''; print ''; @@ -1997,7 +2024,7 @@ if ($action == 'create') print ''; print ''; if (!empty($currency_tx)) print ''; - + dol_fiche_head(''); print ''; @@ -2051,7 +2078,7 @@ if ($action == 'create') { $invoice_predefined = new FactureRec($db); $invoice_predefined->fetch(GETPOST('fac_rec','int')); - + $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later $sql = 'SELECT r.rowid, r.titre, r.total_ttc'; @@ -2158,31 +2185,34 @@ if ($action == 'create') if ((empty($origin)) || ((($origin == 'propal') || ($origin == 'commande')) && (! empty($originid)))) { // Deposit - print '
'; - $tmp=' '; - print ''; - - $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); - print '
'; - if (($origin == 'propal') || ($origin == 'commande')) - { - print ''; - print '
'; - print $desc; - print ''; - $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); - print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); - print '' . $langs->trans('Value') . ':'; - } - print '
'; - - print ''; + if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) + { + print '
'; + $tmp=' '; + print ''; + + $desc = $form->textwithpicto($tmp.$langs->trans("InvoiceDeposit"), $langs->transnoentities("InvoiceDepositDesc"), 1, 'help', '', 0, 3); + print ''; + if (($origin == 'propal') || ($origin == 'commande')) + { + print ''; + print '
'; + print $desc; + print ''; + $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); + print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1); + print '' . $langs->trans('Value') . ':'; + } + print '
'; + + print '
'; + } } if ($socid > 0) @@ -2212,32 +2242,36 @@ if ($action == 'create') } // Replacement - print '
'; - $tmp=' - jQuery(document).ready(function() { - jQuery("#fac_replacement").change(function() { - jQuery("#radio_replacement").prop("checked", true); - }); - }); - '; - $text = $tmp.$langs->trans("InvoiceReplacementAsk") . ' '; - $text .= ' + jQuery(document).ready(function() { + jQuery("#fac_replacement").change(function() { + jQuery("#radio_replacement").prop("checked", true); + }); + }); + '; + $text = $tmp.$langs->trans("InvoiceReplacementAsk") . ' '; + $text .= ''; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); + print $desc; + print '
'; } - $text .= ''; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); - print $desc; - print ''; } else { @@ -2254,48 +2288,51 @@ if ($action == 'create') { if ($socid > 0) { - // Credit note - print '
'; - $tmp=' - jQuery(document).ready(function() { - if (! jQuery("#radio_creditnote").is(":checked")) - { - jQuery("#credit_note_options").hide(); - } - jQuery("#radio_creditnote").click(function() { - jQuery("#credit_note_options").show(); - }); - jQuery("#radio_standard, #radio_replacement, #radio_deposit").click(function() { - jQuery("#credit_note_options").hide(); - }); - }); - '; - $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; - // $text.=''; - $text .= ''; - $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); - print $desc; - - print '
'; - print '    0 ? 'checked':'').' /> "; - print '
    0 ? 'checked':'').' /> "; - print '
'; - - print '
'; + // Credit note + if (empty($conf->global->INVOICE_DISABLE_CREDIT_NOTE)) + { + print '
'; + $tmp=' + jQuery(document).ready(function() { + if (! jQuery("#radio_creditnote").is(":checked")) + { + jQuery("#credit_note_options").hide(); + } + jQuery("#radio_creditnote").click(function() { + jQuery("#credit_note_options").show(); + }); + jQuery("#radio_standard, #radio_replacement, #radio_deposit").click(function() { + jQuery("#credit_note_options").hide(); + }); + }); + '; + $text = $tmp.$langs->transnoentities("InvoiceAvoirAsk") . ' '; + // $text.=''; + $text .= ''; + $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); + print $desc; + + print '
'; + print '    0 ? 'checked':'').' /> "; + print '
    0 ? 'checked':'').' /> "; + print '
'; + + print '
'; + } } else { @@ -2317,7 +2354,7 @@ if ($action == 'create') $desc = $form->textwithpicto($text, $langs->transnoentities("YouMustCreateStandardInvoiceFirstDesc"), 1, 'help', '', 0, 3); print $desc; print ''; - + print ''; print ''; @@ -2343,7 +2380,7 @@ if ($action == 'create') } // Date invoice - print '' . $langs->trans('Date') . ''; + print '' . $langs->trans('DateInvoice') . ''; $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); print $form->select_date($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1, 1); print ''; @@ -2356,7 +2393,7 @@ if ($action == 'create') print $form->select_date($date_pointoftax?$date_pointoftax:-1, 'date_pointoftax', '', '', '', "add", 1, 1, 1); print ''; } - + // Payment term print '' . $langs->trans('PaymentConditionsShort') . ''; $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); @@ -2421,7 +2458,7 @@ if ($action == 'create') print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print ''; } - + // Public note print ''; print '' . $langs->trans('NotePublic') . ''; @@ -2504,7 +2541,7 @@ if ($action == 'create') print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($objectsrc->total_localtax2) . ""; } print '' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . ""; - + if (!empty($conf->multicurrency->enabled)) { print '' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . ''; @@ -3030,7 +3067,7 @@ else if ($id > 0 || ! empty($ref)) // Date invoice print ''; print ''; if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer && empty($conf->global->FAC_FORCE_DATE_VALIDATION)) print ''; @@ -3069,13 +3106,13 @@ else if ($id > 0 || ! empty($ref)) $nbrows ++; if (! empty($conf->multicurrency->enabled)) $nbrows+=5; if (! empty($conf->incoterm->enabled)) $nbrows+=1; - + print ''; - } + } // Conditions de reglement print ''; - + // Multicurrency rate print ''; print ''; print ''; print ''; - + // Multicurrency Amount VAT print ''; print ''; print ''; - + // Multicurrency Amount TTC print ''; print ''; - print ''; + print ''; } // Statut @@ -3919,7 +3956,7 @@ else if ($id > 0 || ! empty($ref)) } // Classify 'closed not completely paid' (possible si validee et pas encore classee payee) - + if ($object->statut == 1 && $object->paye == 0 && $resteapayer > 0 && $user->rights->facture->paiement) { if ($totalpaye > 0 || $totalcreditnotes > 0) @@ -3931,11 +3968,11 @@ else if ($id > 0 || ! empty($ref)) { if ( empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { - if ($objectidnext) + if ($objectidnext) { print '
' . $langs->trans('ClassifyCanceled') . '
'; } - else + else { print '
' . $langs->trans('ClassifyCanceled') . '
'; } diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 1172769e95a..8300545cb22 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -50,7 +50,9 @@ $result = restrictedArea($user, 'facture', $id); $now=dol_now(); -llxHeader('',$langs->trans("Bill"),'Facture'); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Preview'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $form = new Form($db); @@ -83,7 +85,7 @@ if ($id > 0 || ! empty($ref)) $linkback = '' . $langs->trans("BackToList") . ''; // Ref - print ''; // Dates - print ''; + print ''; print ''; // Right part with $rowspan lines diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 001b9058b24..3bc60390d61 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1738,7 +1738,7 @@ class Facture extends CommonInvoice * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @return int <0 if KO, >0 if OK */ - function set_paid($user,$close_code='',$close_note='') + function set_paid($user, $close_code='', $close_note='') { $error=0; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index a7fa51ff5ae..ebc90fca6c5 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -114,7 +114,9 @@ else if ($action == 'deletecontact' && $user->rights->facture->creer) * View */ -llxHeader('', $langs->trans("InvoiceCustomer")); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('ContactsAddresses'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $form = new Form($db); $formcompany = new FormCompany($db); @@ -163,7 +165,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Ref customer - print ''; print ''; + // Third party print ''; print ''; - // Title - print ''; - // Note public print '
'; - print $langs->trans('Date'); + print $langs->trans('DateInvoice'); print 'id . '">' . img_edit($langs->trans('SetDate'), 1) . ''; if ($object->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_USE_SITUATION)) { if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) print ''; - + if (count($object->tab_previous_situation_invoice) > 0) { //List of previous invoices @@ -3088,7 +3125,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $total_prev_ht = $total_prev_ttc = 0; $var = true; foreach ($object->tab_previous_situation_invoice as $prev_invoice) @@ -3105,10 +3142,10 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $var = !$var; } - + print ''; print ''; print ''; @@ -3116,7 +3153,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - + if (count($object->tab_next_situation_invoice) > 0) { //List of next invoices @@ -3129,9 +3166,9 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $total_next_ht = $total_next_ttc = 0; - + $var = true; foreach ($object->tab_next_situation_invoice as $next_invoice) { @@ -3147,10 +3184,10 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - + $var = !$var; } - + print ''; print ''; print ''; @@ -3158,7 +3195,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - + if (count($object->tab_previous_situation_invoice) > 0 || count($object->tab_next_situation_invoice) > 0) print '
' . $langs->trans('AmountTTC') . ' 
' . price($prev_invoice->total_ttc) . ''.$prev_invoice->getLibStatut(3, $totalpaye).'
' . price($total_prev_ht) . ' 
' . $langs->trans('AmountTTC') . ' 
' . price($next_invoice->total_ttc) . ''.$next_invoice->getLibStatut(3, $totalpaye).'
' . price($total_next_ht) . ' 
'; } @@ -3385,7 +3422,7 @@ else if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_pointoftax, 'daytext'); } print '
'; @@ -3470,7 +3507,7 @@ else if ($id > 0 || ! empty($ref)) $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print '
'; @@ -3611,16 +3648,16 @@ else if ($id > 0 || ! empty($ref)) print '
' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
' . $langs->trans('Ref') . ''; + print '
' . $langs->trans('Ref') . ''; $morehtmlref = ''; $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, $object->id); @@ -238,7 +240,7 @@ if ($id > 0 || ! empty($ref)) print '
'.$langs->trans("Date").'
'.$langs->trans("DateInvoice").''.dol_print_date($object->date,"daytext").'
'; + print '
'; print $langs->trans('RefCustomer'); print ''; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b25d52c173b..9a15b7875d8 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -82,7 +82,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; * View */ -llxHeader('', $langs->trans("InvoiceCustomer")); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Documents'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $form = new Form($db); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 4198640701e..b6b9ca87ac5 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Juanjo Menent @@ -128,6 +128,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once +if (GETPOST('cancel')) $action=''; + // Create predefined invoice if ($action == 'add') { @@ -266,6 +268,16 @@ elseif ($action == 'classin' && $user->rights->facture->creer) $object->setProject(GETPOST('projectid', 'int')); } // Set bank account +elseif ($action == 'setref' && $user->rights->facture->creer) +{ + $result=$object->setValueFrom('titre', GETPOST('ref', 'alpha')); + if ($result > 0) + { + $object->titre = GETPOST('ref', 'alpha'); + $object->ref = $object->titre; + } +} +// Set bank account elseif ($action == 'setbankaccount' && $user->rights->facture->creer) { $result=$object->setBankAccount(GETPOST('fk_account', 'int')); @@ -840,15 +852,15 @@ if ($action == 'create') $object->fetch_thirdparty(); + // Title + print '
'.$langs->trans("Title").''; + print ''; + print '
'.$langs->trans("Customer").''.$object->thirdparty->getNomUrl(1,'customer').'
'.$langs->trans("Title").''; - print ''; - print '
'.$langs->trans("NotePublic").''; print ''; @@ -950,176 +962,7 @@ if ($action == 'create') } print "
\n"; - - /* - print ''; - print ''; if ($flag_price_may_change) @@ -1159,7 +1002,7 @@ else if ($action == 'ask_deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); } - + print $formconfirm; $author = new User($db); @@ -1178,20 +1021,13 @@ else $linkback = '' . $langs->trans("BackToList") . ''; // Ref - print ''; - print ''; + print ''; @@ -1324,7 +1160,7 @@ else print '
'; - - $sql = 'SELECT l.fk_product, l.product_type, l.label as custom_label, l.description, l.qty, l.rowid, l.tva_tx,'; - $sql.= ' l.fk_remise_except,'; - $sql.= ' l.remise_percent, l.subprice, l.info_bits,'; - $sql.= ' l.total_ht, l.total_tva as total_vat, l.total_ttc,'; - $sql.= ' l.date_start,'; - $sql.= ' l.date_end,'; - $sql.= ' l.product_type,'; - $sql.= ' l.fk_unit,'; - $sql.= ' p.ref, p.fk_product_type, p.label as product_label,'; - $sql.= ' p.description as product_desc'; - $sql.= " FROM ".MAIN_DB_PREFIX."facturedet as l"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid"; - $sql.= " WHERE l.fk_facture = ".$object->id; - $sql.= " ORDER BY l.rowid"; - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; $total = 0; - - echo ''; - if ($num) - { - print ''; - print ''; - print ''; - print ''; - if ($conf->global->PRODUCT_USE_UNITS) { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) print ''; - print "\n"; - } - $var=true; - while ($i < $num) - { - $objp = $db->fetch_object($result); - - if ($objp->fk_product > 0) - { - $product = New Product($db); - $product->fetch($objp->fk_product); - } - - $var=!$var; - print ""; - - // Show product and description - $type=(isset($objp->product_type)?$objp->product_type:$objp->fk_product_type); - $product_static->fk_unit=$objp->fk_unit; - - if ($objp->fk_product > 0) - { - print ''; - } - else - { - print '\n"; - } - - // Vat rate - print ''; - - // Qty - print ''; - - if ($conf->global->PRODUCT_USE_UNITS) { - print ''; - } - - // Percent - if ($objp->remise_percent > 0) - { - print '\n"; - } - else - { - print ''; - } - - // Total HT - print '\n"; - - // Total VAT - print '\n"; - - // Total TTC - print '\n"; - - // Total Unit price - print '\n"; - - // Current price of product - if (empty($conf->global->PRODUIT_MULTIPRICES)) - { - if ($objp->fk_product > 0) - { - $flag_price_may_change++; - $prodprice=$product_static->price; // price HT - print '\n"; - } - else - { - print ''; - } - } - - print ""; - - $i++; - } - - $db->free($result); - - } - else - { - print $db->error(); - } - print "
'.$langs->trans("Description").''.$langs->trans("VAT").''.$langs->trans("Qty").''.$langs->trans("Unit").''.$langs->trans("ReductionShort").''.$langs->trans("TotalHT").''.$langs->trans("TotalVAT").''.$langs->trans("TotalTTC").''.$langs->trans("PriceUHT").''.$langs->trans("CurrentProductPrice").'
'; - - print ''; // ancre pour retourner sur la ligne - - // Show product and description - $product_static->fetch($objp->fk_product); // We need all information later - $text=$product_static->getNomUrl(1); - $text.= ' - '.(! empty($objp->custom_label)?$objp->custom_label:$objp->product_label); - $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); - print $form->textwithtooltip($text,$description,3,'','',$i); - - // Show range - print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end)); - - // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) - print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; - - print '
'; - print ''; // ancre pour retourner sur la ligne - - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - - if (! empty($objp->custom_label)) { - - $text.= ' '.$objp->custom_label.''; - print $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i); - - } else { - - print $text.' '.nl2br($objp->description); - } - - // Show range - print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end)); - - print "'.vatrate($objp->tva_tx).'%'.$objp->qty.''.$product_static->getLabelOfUnit().''.$objp->remise_percent." % '.price($objp->total_ht)."'.price($objp->total_vat)."'.price($objp->total_ttc)."'.price($objp->subprice)."'.price($prodprice)." 
"; - */ - + print '
' . $langs->trans('Ref') . ''; - $morehtmlref = ''; - /* - require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; - $discount = new DiscountAbsolute($db); - $result = $discount->fetch(0, $object->id); - if ($result > 0) { - $morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')'; - } - if ($result < 0) { - dol_print_error('', $discount->error); - }*/ - print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'titre', $morehtmlref); + print '
'; + //print $langs->trans('Ref'); + print $form->editfieldkey($langs->trans("Ref"), 'ref', $object->ref, $object, $user->rights->facture->creer); + print ''; + $morehtmlref = $form->editfieldval($langs->trans("Ref"), 'ref', $object->ref, $object, $user->rights->facture->creer, 'string'); + print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'none', $morehtmlref); print '
'; // if "frequency" is empty or = 0, the reccurence is disabled - print ''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index b8a5779c708..f0b520bb11e 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -230,7 +230,7 @@ foreach ($tabfac as $key => $val) if (isset($line['nomtcheck']) || $mt) { print ""; - print ""; + print ""; print ""; print ""; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 0cbd5068077..670d89fd2cb 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -263,7 +263,7 @@ foreach ($tabfac as $key => $val) if (isset($line['nomtcheck']) || $mt) { print ""; - print ""; + print ""; print ""; print ""; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index e230d91e6ae..17882e76a6a 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -229,7 +229,10 @@ if ($resql) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"c.libelle","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Numero"),$_SERVER["PHP_SELF"],"p.num_paiement","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) + { + print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); + } print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$param,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$param,'align="left"',$sortfield,$sortorder); @@ -260,9 +263,12 @@ if ($resql) print ''; - print ''; + if (! empty($conf->banque->enabled)) + { + print ''; + } print ''; @@ -309,16 +315,21 @@ if ($resql) // Payment number print ''; - - print ''; + + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + } + // Amount print ''; if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 06a32c3865f..3822f9f91f5 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("bills"); -$chid=GETPOST("id"); -$action=GETPOST('action'); +$chid=GETPOST("id", 'int'); +$action=GETPOST('action', 'alpha'); $amounts = array(); // Security check @@ -45,13 +45,13 @@ if ($user->societe_id > 0) * Actions */ -if ($action == 'add_payment') +if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes')) { $error=0; if ($_POST["cancel"]) { - $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; + $loc = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid; header("Location: ".$loc); exit; } @@ -109,7 +109,7 @@ if ($action == 'add_payment') if (! $error) { - $paymentid = $paiement->create($user); + $paymentid = $paiement->create($user, (GETPOST('closepaidcontrib')=='on'?1:0)); if ($paymentid < 0) { $errmsg=$paiement->error; @@ -130,7 +130,7 @@ if ($action == 'add_payment') if (! $error) { $db->commit(); - $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; + $loc = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$chid; header('Location: '.$loc); exit; } @@ -155,7 +155,7 @@ $form=new Form($db); // Formulaire de creation d'un paiement de charge -if ($_GET["action"] == 'create') +if ($action == 'create') { $charge = new ChargeSociales($db); @@ -185,7 +185,7 @@ if ($_GET["action"] == 'create') print ""; - print ''; + print ''; print '\n"; print '\n"; print '\n"; @@ -317,8 +317,9 @@ if ($_GET["action"] == 'create') print "
'; + print '
'; print ''; @@ -1427,7 +1263,7 @@ else print '
'; print $langs->trans('Frequency'); print '
'; // Nb of generation already done - print ''; + print ''; print ''; @@ -1807,7 +1643,7 @@ else $i++; } } - else print ''; + else print ''; print "
'.$langs->trans("NbOfGenerationDone").'
'.$langs->trans("NbOfGenerationDone").''; print $object->nb_gen_done?$object->nb_gen_done:'0'; print '
'.$langs->trans("NoneF").'
'.$langs->trans("NoneF").'
"; $db->free($resql); diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index 250848319f3..419cacf4cff 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; +$langs->load("companies"); $langs->load("bills"); @@ -35,7 +36,9 @@ $langs->load("bills"); * View */ -llxHeader('', $langs->trans("InvoiceCustomer")); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $fac = new Facture($db); $fac->fetch($_GET["facid"]); diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 77d3817d911..4b4b68a7cf4 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -60,7 +60,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, * View */ -llxHeader('', $langs->trans("InvoiceCustomer")); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Notes'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $form = new Form($db); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 74a41dee31c..87a27166ae8 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -106,7 +106,9 @@ if ($action == "delete") $now=dol_now(); -llxHeader('', $langs->trans("InvoiceCustomer")); +$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('StandingOrders'); +$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes"; +llxHeader('', $title, $helpurl); $form = new Form($db); @@ -290,7 +292,7 @@ if ($object->id > 0) // Date invoice print '
'; print ''; if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; print '
'; - print $langs->trans('Date'); + print $langs->trans('DateInvoice'); print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 35a56e5afb3..1dd1c46299a 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -117,7 +117,7 @@ if (count($listofsearchfields)) { if ($i == 0) print '
'.$langs->trans("Search").'
:
".dol_print_date($val["date"])."".dol_print_date($db->jdate($val["date"]))."".$invoicestatic->getNomUrl(1)."".$k."".$line['label']."
".dol_print_date($val["date"])."".dol_print_date($db->jdate($val["date"]))."".$invoicestatic->getNomUrl(1)."".$k."".$line['label']."'; print ''; print ''; - $form->select_comptes($search_account,'search_account',0,'',1); - print ''; + $form->select_comptes($search_account,'search_account',0,'',1); + print ''; print ''; print ''.$objp->num_paiement.''; - if ($objp->bid) - { - $accountstatic->id=$objp->bid; - $accountstatic->label=$objp->label; - print $accountstatic->getNomUrl(1); - } - else print ' '; - print ''; + if ($objp->bid) + { + $accountstatic->id=$objp->bid; + $accountstatic->label=$objp->label; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print ''.price($objp->amount).'
".$langs->trans("SocialContribution")."
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Ref").''.$chid.'
'.$langs->trans("Type")."".$charge->type_libelle."
'.$langs->trans("Period")."".dol_print_date($charge->periode,'day')."
'.$langs->trans("Label").''.$charge->lib."
"; - print '
'; - print ''; + // Bouton Save payment + print '
'.$langs->trans("ClosePaidContributionsAutomatically"); + print '
'; print '     '; print ''; print '
'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index ad59687b43c..0ea48d9075c 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -65,7 +65,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT."/compta/charges/index.php?mode=sconly"); + header("Location: ".DOL_URL_ROOT."/compta/sociales/payments.php?mode=sconly"); exit; } else @@ -162,25 +162,25 @@ if ($action == 'valide') print ''; // Ref -print ''; +print ''; print ''; // Date -print ''; +print ''; // Mode -print ''; +print ''; // Numero -print ''; +print ''; // Montant -print ''; +print ''; // Note -print ''; +print ''; // Bank account if (! empty($conf->banque->enabled)) @@ -278,7 +278,7 @@ else dol_print_error($db); } -print ''; +dol_fiche_end(); /* diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 800cd8492c9..12195e5e05e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -22,11 +22,12 @@ /** * \file htdocs/compta/prelevement/class/bonprelevement.class.php * \ingroup prelevement - * \brief Fichier de la classe des bons de prelevements + * \brief File of withdrawal receipts class */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; @@ -103,11 +104,11 @@ class BonPrelevement extends CommonObject } /** - * Add facture to withdrawal + * Add invoice to withdrawal * * @param int $facture_id id invoice to add * @param int $client_id id invoice customer - * @param string $client_nom name of cliente + * @param string $client_nom customer name * @param int $amount amount of invoice * @param string $code_banque code of bank withdrawal * @param string $code_guichet code of bank's office @@ -165,7 +166,7 @@ class BonPrelevement extends CommonObject * * @param int $line_id id line to add * @param int $client_id id invoice customer - * @param string $client_nom name of cliente + * @param string $client_nom customer name * @param int $amount amount of invoice * @param string $code_banque code of bank withdrawal * @param string $code_guichet code of bank's office @@ -181,7 +182,7 @@ class BonPrelevement extends CommonObject if ($concat == 1) { /* - * On aggrege les lignes + * We aggregate the lines */ $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes"; @@ -204,7 +205,7 @@ class BonPrelevement extends CommonObject else { /* - * Pas de d'agregation + * No aggregate */ $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes ("; $sql.= "fk_prelevement_bons"; @@ -375,7 +376,7 @@ class BonPrelevement extends CommonObject } /* - * Fin de la procedure + * End of procedure */ if ($error == 0) { @@ -477,7 +478,7 @@ class BonPrelevement extends CommonObject $error++; } } - // Update prelevement line + // Update withdrawal line // TODO: Translate to ligneprelevement.class.php $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes"; $sql.= " SET statut = 2"; @@ -604,8 +605,8 @@ class BonPrelevement extends CommonObject $arr = array(); /* - * Renvoie toutes les factures presente - * dans un bon de prelevement + * Returns all invoices presented + * within a withdrawal receipt */ $sql = "SELECT fk_facture"; if ($amounts) $sql .= ", SUM(pl.amount)"; @@ -1015,15 +1016,21 @@ class BonPrelevement extends CommonObject $this->date_echeance = $datetimeprev; $this->reference_remise = $ref; - $this->raison_sociale = $conf->global->PRELEVEMENT_RAISON_SOCIALE; + $id=$conf->global->PRELEVEMENT_ID_BANKACCOUNT; + $account = new Account($this->db); + if ($account->fetch($id)>0) + { + $this->emetteur_code_banque = $account->code_banque; + $this->emetteur_code_guichet = $account->code_guichet; + $this->emetteur_numero_compte = $account->number; + $this->emetteur_number_key = $account->cle_rib; + $this->emetteur_iban = $account->iban; + $this->emetteur_bic = $account->bic; - $this->emetteur_code_banque = $conf->global->PRELEVEMENT_CODE_BANQUE; - $this->emetteur_code_guichet = $conf->global->PRELEVEMENT_CODE_GUICHET; - $this->emetteur_numero_compte = $conf->global->PRELEVEMENT_NUMERO_COMPTE; - $this->emetteur_number_key = $conf->global->PRELEVEMENT_NUMBER_KEY; - $this->emetteur_iban = $conf->global->PRELEVEMENT_IBAN; - $this->emetteur_bic = $conf->global->PRELEVEMENT_BIC; - $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; + $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; + + $this->raison_sociale = $account->proprio; + } $this->factures = $factures_prev_id; @@ -1673,13 +1680,31 @@ class BonPrelevement extends CommonObject * @return string String with SEPA Sender */ function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') - { // SEPA INITIALISATION - global $confs; + { + // SEPA INITIALISATION + global $conf; $dateTime_YMD = dol_print_date($ladate, '%Y%m%d'); $dateTime_ETAD = dol_print_date($ladate, '%Y-%m-%d'); $dateTime_YMDHMS = dol_print_date($ladate, '%Y-%m-%dT%H:%M:%S'); + // Get data of bank account + $id=$configuration->global->PRELEVEMENT_ID_BANKACCOUNT; + $account = new Account($this->db); + if ($account->fetch($id)>0) + { + $this->emetteur_code_banque = $account->code_banque; + $this->emetteur_code_guichet = $account->code_guichet; + $this->emetteur_numero_compte = $account->number; + $this->emetteur_number_key = $account->cle_rib; + $this->emetteur_iban = $account->iban; + $this->emetteur_bic = $account->bic; + + $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; + + $this->raison_sociale = $account->proprio; + } + // Récupération info demandeur $sql = "SELECT rowid, ref"; $sql.= " FROM"; @@ -1714,7 +1739,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$dateTime_ETAD.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($configuration->global->PRELEVEMENT_RAISON_SOCIALE)).''.$CrLf; + $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($this->raison_sociale)).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $XML_SEPA_INFO .= ' '.strtoupper(dol_string_unaccent($configuration->global->MAIN_INFO_SOCIETE_ADDRESS)).''.$CrLf; @@ -1723,16 +1748,16 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.preg_replace('/\s/', '', $configuration->global->PRELEVEMENT_IBAN).''.$CrLf; + $XML_SEPA_INFO .= ' '.preg_replace('/\s/', '', $this->emetteur_iban).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$configuration->global->PRELEVEMENT_BIC.''.$CrLf; + $XML_SEPA_INFO .= ' '.$this->emetteur_bic.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; /* $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.''.$CrLf; + $XML_SEPA_INFO .= ' '.$this->raison_sociale.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; $XML_SEPA_INFO .= ' '.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.''.$CrLf; @@ -1744,7 +1769,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; - $XML_SEPA_INFO .= ' '.$configuration->global->PRELEVEMENT_ICS.''.$CrLf; + $XML_SEPA_INFO .= ' '.$this->emetteur_ics.''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' SEPA'.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index f39fd0780ad..ea0070ef50b 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -415,7 +415,7 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; } diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index f279e97b478..3e3fca22ffa 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015-2016 Laurent Destailleur - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Laurent Destailleur + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -25,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("compta"); $langs->load("salaries"); @@ -40,6 +41,8 @@ $search_ref = GETPOST('search_ref','int'); $search_user = GETPOST('search_user','alpha'); $search_label = GETPOST('search_label','alpha'); $search_amount = GETPOST('search_amount','alpha'); +$search_account = GETPOST('search_account','int'); + $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -68,11 +71,12 @@ else $typeid=$_REQUEST['typeid']; } -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.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_ref=""; $search_label=""; $search_amount=""; + $search_account=''; $typeid=""; } @@ -85,12 +89,16 @@ llxHeader(); $form = new Form($db); $salstatic = new PaymentSalary($db); $userstatic = new User($db); +$accountstatic = new Account($db); $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc,"; -$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment,"; +$sql.= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,"; +$sql.= " ba.rowid as bid, ba.label as blabel,"; $sql.= " pst.code as payment_code"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id,"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON s.fk_typepayment = pst.id"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,"; $sql.= " ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.rowid = s.fk_user"; $sql.= " AND s.entity = ".$conf->entity; @@ -100,6 +108,7 @@ if ($search_ref) $sql.=" AND s.rowid=".$search_ref; if ($search_user) $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $search_user); if ($search_label) $sql.=natural_search(array('s.label'), $search_label); if ($search_amount) $sql.=natural_search("s.amount", $search_amount, 1); +if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($filtre) { $filtre=str_replace(":","=",$filtre); $sql .= " AND ".$filtre; @@ -145,11 +154,11 @@ if ($result) print '
'.$langs->trans('Ref').'
'.$langs->trans('Ref').''; print $form->showrefnav($paiement,'id','',1,'rowid','id'); print '
'.$langs->trans('Date').''.dol_print_date($paiement->datep,'day').'
'.$langs->trans('Date').''.dol_print_date($paiement->datep,'day').'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$paiement->type_code).'
'.$langs->trans('Mode').''.$langs->trans("PaymentType".$paiement->type_code).'
'.$langs->trans('Numero').''.$paiement->num_paiement.'
'.$langs->trans('Numero').''.$paiement->num_paiement.'
'.$langs->trans('Amount').''.price($paiement->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Amount').''.price($paiement->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'
'.$langs->trans('Note').''.nl2br($paiement->note).'
'.$langs->trans('Note').''.nl2br($paiement->note).'
'; print ''; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"s.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.salary","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Employee"),$_SERVER["PHP_SELF"],"u.rowid","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -159,12 +168,10 @@ if ($result) print ''; - // People + // Employee print ''; - // Current salary - print ''; // Label print ''; // Date @@ -173,6 +180,13 @@ if ($result) print ''; + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + } // Amount print ''; @@ -200,17 +214,29 @@ if ($result) $salstatic->ref=$obj->rowid; // Ref print "\n"; - // User name + // Employee print "\n"; - // Current salary - print "\n"; // Label payment print "\n"; // Date payment print '\n"; // Type print ''; - // Amount + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + } + // Amount print ""; print ""; print "\n"; @@ -219,8 +245,10 @@ if ($result) $i++; } - - print ''; + + $colspan=5; + if (! empty($conf->banque->enabled)) $colspan++; + print ''; print '"; print ""; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/card.php similarity index 96% rename from htdocs/compta/sociales/charges.php rename to htdocs/compta/sociales/card.php index f5a6cc2f6a9..8c21bf32ceb 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/card.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/compta/sociales/charges.php + * \file htdocs/compta/sociales/card.php * \ingroup tax * \brief Social contribution card page */ @@ -382,7 +382,7 @@ if ($id > 0) if ($action == 'edit') { - print "id&action=update\" method=\"post\">"; + print "id&action=update\" method=\"post\">"; print ''; } @@ -585,13 +585,13 @@ if ($id > 0) // Reopen if ($object->paye && $user->rights->tax->charges->creer) { - print "id&action=reopen\">".$langs->trans("ReOpen").""; + print "id&action=reopen\">".$langs->trans("ReOpen").""; } // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { - print "id&action=edit\">".$langs->trans("Modify").""; + print "id&action=edit\">".$langs->trans("Modify").""; } // Emit payment @@ -603,19 +603,19 @@ if ($id > 0) // Classify 'paid' if ($object->paye == 0 && round($resteapayer) <=0 && $user->rights->tax->charges->creer) { - print "id&action=paid\">".$langs->trans("ClassifyPaid").""; + print "id&action=paid\">".$langs->trans("ClassifyPaid").""; } // Clone if ($user->rights->tax->charges->creer) { - print "id&action=clone\">".$langs->trans("ToClone").""; + print "id&action=clone\">".$langs->trans("ToClone").""; } // Delete if ($user->rights->tax->charges->supprimer) { - print "id&action=delete\">".$langs->trans("Delete").""; + print "id&action=delete\">".$langs->trans("Delete").""; } print ""; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index af3acbf4c7f..ca9af965758 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -449,7 +449,7 @@ class ChargeSociales extends CommonObject if (empty($this->ref)) $this->ref=$this->lib; $label = $langs->trans("ShowSocialContribution").': '.$this->ref; - $link = ''; + $link = ''; $linkend=''; if ($withpicto) $result.=($link.img_object($label, 'bill', 'class="classfortooltip"').$linkend.' '); diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index e3bf17b3418..1d553831f99 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -23,6 +23,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; /** @@ -64,10 +65,11 @@ class PaymentSocialContribution extends CommonObject * Create payment of social contribution into database. * Use this->amounts to have list of lines for the payment * - * @param User $user User making payment - * @return int <0 if KO, id of payment if OK + * @param User $user User making payment + * @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more + * @return int <0 if KO, id of payment if OK */ - function create($user) + function create($user, $closepaidcontrib=0) { global $conf, $langs; @@ -75,7 +77,9 @@ class PaymentSocialContribution extends CommonObject $now=dol_now(); - // Validate parametres + dol_syslog(get_class($this)."::create", LOG_DEBUG); + + // Validate parametres if (! $this->datepaye) { $this->error='ErrorBadValueForParameterCreatePaymentSocialContrib'; @@ -117,11 +121,40 @@ class PaymentSocialContribution extends CommonObject $sql.= " ".$this->paiementtype.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($this->note)."', ".$user->id.","; $sql.= " 0)"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge"); + + // Insere tableau des montants / factures + foreach ($this->amounts as $key => $amount) + { + $contribid = $key; + if (is_numeric($amount) && $amount <> 0) + { + $amount = price2num($amount); + + // If we want to closed payed invoices + if ($closepaidcontrib) + { + + $contrib=new ChargeSociales($this->db); + $contrib->fetch($contribid); + $paiement = $contrib->getSommePaiement(); + //$creditnotes=$contrib->getSumCreditNotesUsed(); + $creditnotes=0; + //$deposits=$contrib->getSumDepositsUsed(); + $deposits=0; + $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); + $remaintopay=price2num($contrib->amount - $paiement - $creditnotes - $deposits,'MT'); + if ($remaintopay == 0) + { + $result=$contrib->set_paid($user, '', ''); + } + else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing."); + } + } + } } else { diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 15ca799c1c2..fc106de2ad1 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2016 Frédéric France * @@ -233,7 +233,7 @@ if ($resql) print ''; // Type - print ''; + print ''; // Date end period print ''; + } - // Type payment - print '\n"; - print ""; - - // Number - print ''."\n"; - } - + // Type payment + print '\n"; + print ""; + + // Number + print ''."\n"; + // Other attributes $parameters=array('colspan' => ' colspan="1"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -365,8 +365,8 @@ if ($id) /* - * Boutons d'actions - */ + * Action buttons + */ print "
\n"; if ($object->rappro == 0) { @@ -381,7 +381,7 @@ if ($id) } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print "
"; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index f6308a3790d..30d9655acc8 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -123,17 +123,9 @@ print $langs->trans("VATReportBuildWithOptionDefinedInModule").'
'; print '('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')
'; print '
'; -print '
'; print ''; print ''; print ''; print ' '; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print ''; + $form->select_comptes($search_account,'search_account',0,'',1); + print '".$salstatic->getNomUrl(1)."".$userstatic->getNomUrl(1)."".($obj->salary?price($obj->salary):'')."".dol_trunc($obj->label,40)."'.dol_print_date($db->jdate($obj->datep),'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; + if ($obj->fk_bank > 0) + { + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id=$obj->bid; + $accountstatic->label=$obj->blabel; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print '".price($obj->amount)."
'.$langs->trans("Total").'
'.$langs->trans("Total").''.price($total)."
'.dol_trunc($obj->libelle,42).''.dol_trunc($obj->type_lib,16).''.$obj->type_lib.''; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php new file mode 100644 index 00000000000..017bcb7686e --- /dev/null +++ b/htdocs/compta/sociales/payments.php @@ -0,0 +1,490 @@ + + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compta/sociales/payments.php + * \ingroup compta + * \brief Page to list payments of special expenses + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + +$langs->load("compta"); +$langs->load("bills"); + +// Security check +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); + +$mode=GETPOST("mode",'alpha'); +$year=GETPOST("year",'int'); +$filtre=GETPOST("filtre",'alpha'); +if (! $year && $mode != 'sconly') { $year=date("Y", time()); } + +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="pc.datep"; +if (! $sortorder) $sortorder="DESC"; + + +/* + * View + */ + +$tva_static = new Tva($db); +$socialcontrib=new ChargeSociales($db); +$payment_sc_static=new PaymentSocialContribution($db); +$sal_static = new PaymentSalary($db); + +llxHeader('',$langs->trans("SpecialExpensesArea")); + +$title=$langs->trans("SpecialExpensesArea"); +if ($mode == 'sconly') $title=$langs->trans("SocialContributionsPayments"); + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($mode == 'sconly') $param='&mode=sconly'; +if ($sortfield) $param.='&sortfield='.$sortfield; +if ($sortorder) $param.='&sortorder='.$sortorder; + + +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +if ($mode != 'sconly') +{ + $center=($year?''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."":""); + print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); +} +else +{ + print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit); +} + +if ($year) $param.='&year='.$year; + +if ($mode != 'sconly') +{ + print $langs->trans("DescTaxAndDividendsArea").'
'; + print "
"; +} + +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) +{ + // Social contributions only + if ($mode != 'sconly') + { + print load_fiche_titre($langs->trans("SocialContributionsPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + } + + print ''; + print ''; + print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pc.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pc.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"pct.code","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("LabelContrib"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("TypeContrib"),$_SERVER["PHP_SELF"],"cs.fk_type","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"cs.date_ech","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"cs.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); + print "\n"; + + $sql = "SELECT c.id, c.libelle as lib,"; + $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; + $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment,"; + $sql.= " pct.code as payment_code"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; + $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs,"; + $sql.= " ".MAIN_DB_PREFIX."paiementcharge as pc"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id"; + $sql.= " WHERE cs.fk_type = c.id AND pc.fk_charge = cs.rowid"; + $sql.= " AND cs.entity = ".$conf->entity; + if ($year > 0) + { + $sql .= " AND ("; + // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, + // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; + $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; + $sql .= ")"; + } + if (preg_match('/^cs\./',$sortfield) || preg_match('/^c\./',$sortfield) || preg_match('/^pc\./',$sortfield) || preg_match('/^pct\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + //$sql.= $db->plimit($limit+1,$offset); + //print $sql; + + dol_syslog("compta/sociales/payments.php: select payment", LOG_DEBUG); + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + $total = 0; + $totalnb = 0; + $totalpaye = 0; + $var=true; + + while ($i < min($num, $limit)) + { + $obj = $db->fetch_object($resql); + $var = !$var; + print ""; + // Ref payment + $payment_sc_static->id=$obj->pid; + $payment_sc_static->ref=$obj->pid; + print '\n"; + // Date payment + print ''; + // Type payment + print ''; + // Label + print ''; + // Type + print ''; + // Date + $date=$obj->periode; + if (empty($date)) $date=$obj->date_ech; + print ''; + // Expected to pay + print ''; + // Paid + print ''; + print ''; + + $total = $total + $obj->total; + $totalnb = $totalnb + $obj->nb; + $totalpaye = $totalpaye + $obj->totalpaye; + $i++; + } + print ''; + print ''; // A total here has no sense + print ''; + print ''; + print ''; + print '"; + print ""; + } + else + { + dol_print_error($db); + } + print '
'.$payment_sc_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep),'day').''; + if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + print $obj->num_payment.''; + $socialcontrib->id=$obj->rowid; + $socialcontrib->ref=$obj->libelle; + $socialcontrib->lib=$obj->libelle; + print $socialcontrib->getNomUrl(1,'20'); + print ''.$obj->lib.''.dol_print_date($date,'day').''.price($obj->total).''; + if ($obj->totalpaye) print price($obj->totalpaye); + print '
'.$langs->trans("Total").'   '.price($totalpaye)."
'; +} + +// VAT +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) +{ + if (! $mode || $mode != 'sconly') + { + print "
"; + + $tva = new Tva($db); + + print load_fiche_titre($langs->trans("VATPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + + $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm"; + $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; + $sql.= " WHERE pv.entity = ".$conf->entity; + if ($year > 0) + { + // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, + // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + } + if (preg_match('/^pv\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + $total = 0 ; + print ''; + print ''; + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print "\n"; + $var=1; + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total = $total + $obj->amount; + + $var=!$var; + print ""; + print ''."\n"; + + print "\n"; + + print '"; + + // Ref payment + $tva_static->id=$obj->rowid; + $tva_static->ref=$obj->rowid; + print '\n"; + + print '\n"; + print '"; + print "\n"; + + $i++; + } + print ''; + print ''; + print ''; + print ''; + print '"; + print ""; + + print "
'.dol_print_date($db->jdate($obj->dm),'day').'".$obj->label."'.price($obj->amount)."'.$tva_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->dm),'day')."'.price($obj->amount)."
'.$langs->trans("Total").''.price($total).'  '.price($total)."
"; + $db->free($result); + } + else + { + dol_print_error($db); + } + } +} + +// Localtax +if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") +{ + $j=1; + $numlt=3; +} +elseif($mysoc->localtax1_assuj=="1") +{ + $j=1; + $numlt=2; +} +elseif($mysoc->localtax2_assuj=="1") +{ + $j=2; + $numlt=3; +} +else +{ + $j=0; + $numlt=0; +} + +while($j<$numlt) +{ + if (! $mode || $mode != 'sconly') + { + print "
"; + + $tva = new Tva($db); + + print load_fiche_titre($langs->transcountry(($j==1?"LT1Payments":"LT2Payments"),$mysoc->country_code).($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + + + $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp"; + $sql.= " FROM ".MAIN_DB_PREFIX."localtax as pv"; + $sql.= " WHERE pv.entity = ".$conf->entity." AND localtaxtype = ".$j ; + if ($year > 0) + { + // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, + // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + } + if (preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + $total = 0 ; + print ''; + print ''; + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"pv.datev","",$param,'width="120"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"pv.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pv.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); + print "\n"; + $var=1; + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total = $total + $obj->amount; + + $var=!$var; + print ""; + print ''."\n"; + + print "\n"; + + print '"; + + // Ref payment + $tva_static->id=$obj->rowid; + $tva_static->ref=$obj->rowid; + print '\n"; + + print '\n"; + print '"; + print "\n"; + + $i++; + } + print ''; + print '"; + print ''; + print ''; + print '"; + print ""; + + print "
'.dol_print_date($db->jdate($obj->dm),'day').'".$obj->label."'.price($obj->amount)."'.$tva_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->dp),'day')."'.price($obj->amount)."
'.$langs->trans("Total").''.price($total)."  '.price($total)."
"; + $db->free($result); + } + else + { + dol_print_error($db); + } + } + $j++; +} + + +// Payment Salary +if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) +{ + if (! $mode || $mode != 'sconly') + { + $sal = new PaymentSalary($db); + + print "
"; + + print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + + $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; + $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u"; + $sql.= " WHERE s.entity IN (".getEntity('user',1).")"; + $sql.= " AND u.rowid = s.fk_user"; + if ($year > 0) + { + $sql.= " AND (s.datesp between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; + $sql.= " OR s.dateep between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."')"; + } + if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + $total = 0 ; + print ''; + print ''; + print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.dateep","",$param,'width="140px"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"s.label","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"s.rowid","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); + print "\n"; + $var=1; + while ($i < $num) + { + $obj = $db->fetch_object($result); + + $total = $total + $obj->amount; + + $var=!$var; + print ""; + + print ''."\n"; + + print "\n"; + + print '"; + + // Ref payment + $sal_static->id=$obj->rowid; + $sal_static->ref=$obj->rowid; + print '\n"; + + print '\n"; + print '"; + print "\n"; + + $i++; + } + print ''; + print ''; // A total here has no sense + print ''; + print ''; + print '"; + print ""; + + print "
'.dol_print_date($db->jdate($obj->dateep),'day').'".$obj->label."'.($obj->salary?price($obj->salary):'')."'.$sal_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep),'day')."'.price($obj->amount)."
'.$langs->trans("Total").'  '.price($total)."
"; + $db->free($result); + + print "
"; + } + else + { + dol_print_error($db); + } + } +} + +print ''; + + +llxFooter(); + +$db->close(); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index dade07fd0e3..08eb5c001de 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -34,6 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $langs->load("companies"); $langs->load("categories"); +$langs->load("bills"); +$langs->load("compta"); // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES') $modecompta = $conf->global->ACCOUNTING_MODE; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index eb887054151..17bcd80757c 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * @@ -266,19 +266,19 @@ if ($action == 'create') print '
'.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant print '
'.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); - print "
'.$langs->trans('Numero'); - print ' ('.$langs->trans("ChequeOrTransferNumber").')'; - print '
'.$langs->trans("PaymentMode").''; + $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); + print "
'.$langs->trans('Numero'); + print ' ('.$langs->trans("ChequeOrTransferNumber").')'; + print '
'; -print ''; +print '
'; -print '
'; -print '
'; -print load_fiche_titre($langs->trans("VATSummary"), '', ''); -// The report mode is the one defined by defaut in tax module setup -//print $modetax; -//print '('.$langs->trans("SeeVATReportInInputOutputMode",'','').')'; -print ''; -print load_fiche_titre($langs->trans("VATPaid"), '', ''); -print '
'; +print load_fiche_titre($langs->trans("VATSummary"), '', ''); print ''; print ''; @@ -223,18 +215,12 @@ print '\n"; print ''; -/*} - else - { - print ''; - print ''; - }*/ - print '
'.$langs->trans("To print " 
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("FeatureIsSupportedInInOutModeOnly").'
'; -print '
'; +print '
'; + +print load_fiche_titre($langs->trans("VATPaid"), '', ''); /* * Payed @@ -250,10 +236,7 @@ $sql.= " GROUP BY dm ORDER BY dm ASC"; pt($db, $sql,$langs->trans("Year")." $y"); -print "
"; - -print ''; -print ''; +print '
'; llxFooter(); $db->close(); diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 5484be65a32..d5bcbeeb06a 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -26,6 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; @@ -40,6 +41,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges'); $search_ref = GETPOST('search_ref','int'); $search_label = GETPOST('search_label','alpha'); $search_amount = GETPOST('search_amount','alpha'); +$search_account = GETPOST('search_account','int'); $month = GETPOST("month","int"); $year = GETPOST("year","int"); @@ -71,16 +73,18 @@ else $typeid=$_REQUEST['typeid']; } -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.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $search_ref=""; $search_label=""; $search_amount=""; + $search_account=''; $year=""; $month=""; $typeid=""; } + /* * View */ @@ -90,14 +94,19 @@ llxHeader(); $form = new Form($db); $formother=new FormOther($db); $tva_static = new Tva($db); +$accountstatic = new Account($db); -$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, pst.code as payment_code"; +$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, t.fk_bank, pst.code as payment_code,"; +$sql.= " ba.rowid as bid, ba.label as blabel"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " WHERE t.entity = ".$conf->entity; if ($search_ref) $sql.=" AND t.rowid=".$search_ref; if ($search_label) $sql.=" AND t.label LIKE '%".$db->escape($search_label)."%'"; if ($search_amount) $sql.=" AND t.amount='".$db->escape(price2num(trim($search_amount)))."'"; +if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($month > 0) { if ($year > 0) @@ -155,8 +164,9 @@ if ($result) print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder); + if (! empty($conf->banque->enabled)) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; print ''; @@ -172,8 +182,14 @@ if ($result) print ''; $form->select_types_paiements($typeid,'typeid','',0,0,1,16); print ''; + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + $form->select_comptes($search_account,'search_account',0,'',1); + print ''; + } print ''; - print ''; $searchpitco=$form->showFilterAndCheckAddButtons(0); print $searchpitco; @@ -204,15 +220,32 @@ if ($result) print ''.dol_print_date($db->jdate($obj->dp),'day')."\n"; // Type print $type; + // Account + if (! empty($conf->banque->enabled)) + { + print ''; + if ($obj->fk_bank > 0) + { + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id=$obj->bid; + $accountstatic->label=$obj->blabel; + print $accountstatic->getNomUrl(1); + } + else print ' '; + print ''; + } // Amount $total = $total + $obj->amount; print "".price($obj->amount).""; - print " "; + print " "; print "\n"; $i++; } - print ''.$langs->trans("Total").''; + + $colspan=5; + if (! empty($conf->banque->enabled)) $colspan++; + print ''.$langs->trans("Total").''; print "".price($total).""; print " "; diff --git a/htdocs/compta/ventilation/card.php b/htdocs/compta/ventilation/card.php deleted file mode 100644 index 59ed7fe9cde..00000000000 --- a/htdocs/compta/ventilation/card.php +++ /dev/null @@ -1,164 +0,0 @@ - - * Copyright (C) 2005-2006 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/card.php - * \ingroup compta - * \brief Page fiche ventilation - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - -$langs->load("bills"); - -$mesg = ''; - -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - - -/* - * Actions - */ - -if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer) -{ - $sql = " UPDATE ".MAIN_DB_PREFIX."facturedet"; - $sql .= " SET fk_code_ventilation = ".$_POST["codeventil"]; - $sql .= " WHERE rowid = ".$_GET["id"]; - - $db->query($sql); -} - -llxHeader("","","Fiche ventilation"); - -if ($cancel == $langs->trans("Cancel")) -{ - $action = ''; -} -/* - * - * - */ - -$sql = "SELECT rowid, numero, intitule"; -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux"; -$sql .= " ORDER BY numero ASC"; - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $row = $db->fetch_row($result); - $cgs[$row[0]] = $row[1] . ' ' . $row[2]; - $i++; - } -} - -/* - * Cr�ation - * - */ -$form = new Form($db); -$facture_static=new Facture($db); - -if($_GET["id"]) -{ - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,"; - $sql .= " l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice,"; - $sql .= " l.date_start as date_start, l.date_end as date_end,"; - $sql .= " l.fk_code_ventilation "; - $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; - $sql .= " , ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; - - $result = $db->query($sql); - if ($result) - { - $num_lignes = $db->num_rows($result); - $i = 0; - - if ($num_lignes) - { - - $objp = $db->fetch_object($result); - - - if($objp->fk_code_ventilation == 0) - { - print '
'."\n"; - print ''; - print ''; - } - - - print load_fiche_titre("Ventilation"); - - print ''; - - // Ref facture - print ''; - $facture_static->ref=$objp->facnumber; - $facture_static->id=$objp->facid; - print ''; - print ''; - - print ''; - print ''; - print ''; - - if($objp->fk_code_ventilation == 0) - { - print ''; - } - print '
'.$langs->trans("Invoice").''.$facture_static->getNomUrl(1).'
Ligne'.nl2br($objp->description).'
Ventiler dans le compte :'; - - if($objp->fk_code_ventilation == 0) - { - print $form->selectarray("codeventil",$cgs, $objp->fk_code_ventilation); - } - else - { - print $cgs[$objp->fk_code_ventilation]; - } - - print '
 
'; - print '
'; - } - else - { - print "Error"; - } - } - else - { - print "Error"; - } -} -else -{ - print "Error ID incorrect"; -} - -llxFooter(); -$db->close(); diff --git a/htdocs/compta/ventilation/fournisseur/card.php b/htdocs/compta/ventilation/fournisseur/card.php deleted file mode 100644 index dc376de7c06..00000000000 --- a/htdocs/compta/ventilation/fournisseur/card.php +++ /dev/null @@ -1,148 +0,0 @@ - - * Copyright (C) 2005 Simon TOSSER - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/ventilation/fournisseur/card.php - * \ingroup compta - * \brief Page fiche ventilation - */ - -require '../../../main.inc.php'; - -$mesg = ''; - -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - -if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer) -{ - $sql = " UPDATE ".MAIN_DB_PREFIX."facture_fourn_det"; - $sql .= " SET fk_code_ventilation = ".$_POST["codeventil"]; - $sql .= " WHERE rowid = ".$_GET["id"]; - - $db->query($sql); -} - -llxHeader("","","Fiche ventilation"); - -if ($cancel == $langs->trans("Cancel")) -{ - $action = ''; -} -/* - * - * - */ - -$sql = "SELECT rowid, numero, intitule"; -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux"; -$sql .= " ORDER BY numero ASC"; - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - $i = 0; - - while ($i < $num) - { - $row = $db->fetch_row($result); - $cgs[$row[0]] = $row[1] . ' ' . $row[2]; - $i++; - } -} - -/* - * Creation - * - */ -$form = new Form($db); - -if($_GET["id"]) -{ - $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation "; - $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; - $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; - $sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.rowid = ".$_GET["id"]; - - $result = $db->query($sql); - - if ($result) - { - $num_lignes = $db->num_rows($result); - $i = 0; - - if ($num_lignes) - { - - $objp = $db->fetch_object($result); - - - if($objp->fk_code_ventilation == 0) - { - print '
'."\n"; - print ''; - print ''; - } - - - print load_fiche_titre("Ventilation"); - - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - - if($objp->fk_code_ventilation == 0) - { - print ''; - } - print '
Facture'.$objp->facnumber.'
Ligne'.stripslashes(nl2br($objp->description)).'
Ventiler dans le compte :'; - - if($objp->fk_code_ventilation == 0) - { - print $form->selectarray("codeventil",$cgs, $objp->fk_code_ventilation); - } - else - { - print $cgs[$objp->fk_code_ventilation]; - } - - print '
 
'; - print '
'; - } - else - { - print "Error"; - } - } - else - { - print "Error"; - } -} -else -{ - print "Error ID incorrect"; -} - -llxFooter(); -$db->close(); diff --git a/htdocs/compta/ventilation/fournisseur/list.php b/htdocs/compta/ventilation/fournisseur/list.php deleted file mode 100644 index 20ca396aa30..00000000000 --- a/htdocs/compta/ventilation/fournisseur/list.php +++ /dev/null @@ -1,105 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/ventilation/list.php - * \ingroup compta - * \brief Page de ventilation des lignes de facture - */ - -require '../../../main.inc.php'; - -$langs->load("bills"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); -/* - * Securite acces client - */ -if ($user->societe_id > 0) accessforbidden(); - - -llxHeader('','Ventilation'); - -/* - * Lignes de factures - * - */ -$page = $_GET["page"]; -if ($page < 0) $page = 0; -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; -$offset = $limit * $page ; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.rowid, l.fk_code_ventilation "; -$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; -$sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; -$sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND fk_code_ventilation = 0"; -$sql .= " ORDER BY l.rowid DESC ".$db->plimit($limit+1,$offset); - -$result = $db->query($sql); -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste("Lignes de facture à ventiler",$page,"list.php","",$sortfield,$sortorder,'',$num_lignes); - - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - - print ''; - print ''; - - print ''; - - print ''; - - print ""; - $i++; - } - -print "
Facture'.$langs->trans("Description").'  
'.$objp->facnumber.''.stripslashes(nl2br($objp->description)).''; - print price($objp->price); - print ''; - print img_edit(); - print '
"; - - - -} -else -{ - print $db->error(); -} - -llxFooter(); -$db->close(); diff --git a/htdocs/compta/ventilation/list.php b/htdocs/compta/ventilation/list.php deleted file mode 100644 index fc022cade0d..00000000000 --- a/htdocs/compta/ventilation/list.php +++ /dev/null @@ -1,129 +0,0 @@ - - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2006 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/ventilation/list.php - * \ingroup compta - * \brief Page de ventilation des lignes de facture - */ - -require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - -$langs->load("compta"); -$langs->load("bills"); - -if (!$user->rights->facture->lire) accessforbidden(); -if (!$user->rights->compta->ventilation->creer) accessforbidden(); - -// Securite acces client -if ($user->societe_id > 0) accessforbidden(); - - -llxHeader('','Ventilation'); - -/* - * Lignes de factures - */ - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total as price, 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"; -$sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; -$sql.= " , ".MAIN_DB_PREFIX."facturedet as l"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; -$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND fk_code_ventilation = 0"; -$sql.= " AND f.entity = ".$conf->entity; -$sql.= " ORDER BY l.rowid DESC ".$db->plimit($limit+1,$offset); - -$result = $db->query($sql); -if ($result) -{ - $num_lignes = $db->num_rows($result); - $i = 0; - - print_barre_liste($langs->trans("InvoiceLinesToDispatch"),$page,"list.php","",$sortfield,$sortorder,'',$num_lignes); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $facture_static=new Facture($db); - $product_static=new Product($db); - - $var=True; - while ($i < min($num_lignes, $limit)) - { - $objp = $db->fetch_object($result); - $var=!$var; - print ""; - - // Ref facture - $facture_static->ref=$objp->facnumber; - $facture_static->id=$objp->facid; - print ''; - - // Ref produit - $product_static->ref=$objp->product_ref; - $product_static->id=$objp->product_id; - $product_static->type=$objp->type; - print ''; - - print ''; - print ''; - - print ''; - - print ''; - - print ""; - $i++; - } - print "
'.$langs->trans("Invoice").''.$langs->trans("Ref").''.$langs->trans("Label").''.$langs->trans("Description").''.$langs->trans("Montant").' 
'.$facture_static->getNomUrl(1).''; - if ($product_static->id) print $product_static->getNomUrl(1); - else print ' '; - print ''.dol_trunc($objp->product_label,24).''.nl2br(dol_trunc($objp->description,32)).''; - print price($objp->price); - print ''; - print img_edit(); - print '
"; -} -else -{ - print $db->error(); -} - -llxFooter(); -$db->close(); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 512beec77ef..31eb96d633f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -529,10 +529,10 @@ else // Name - print ''; - print 'lastname).'" autofocus="autofocus">'; - print ''; - print 'firstname).'">'; + print ''; + print 'lastname).'" autofocus="autofocus">'; + print ''; + print 'firstname).'">'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) @@ -554,7 +554,7 @@ else } // Civility - print ''; + print ''; print $formcompany->select_civility(GETPOST("civility_id",'alpha')?GETPOST("civility_id",'alpha'):$object->civility_id); print ''; @@ -783,10 +783,10 @@ else } // Lastname - print ''; - print 'lastname).'" autofocus="autofocus">'; - print ''; - print 'firstname).'">'; + print ''; + print 'lastname).'" autofocus="autofocus">'; + print ''; + print 'firstname).'">'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) @@ -890,7 +890,7 @@ else print $form->selectarray('priv',$selectarray,$object->priv,0); print ''; - // Note Public + // Note Public print ''; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1); @@ -902,7 +902,7 @@ else print $doleditor->Create(1); print ''; - // Statut + // Status print ''.$langs->trans("Status").''; print ''; print $object->getLibStatut(4); @@ -1058,7 +1058,7 @@ else // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''.$langs->trans("ThirdParty").''; + print ''.$langs->trans("ThirdParty").''; if ($object->socid > 0) { $objsoc->fetch($object->socid); @@ -1074,7 +1074,7 @@ else print ''; // Civility - print ''.$langs->trans("UserTitle").''; + print ''.$langs->trans("UserTitle").''; print $object->getCivilityLabel(); print ''; @@ -1122,7 +1122,7 @@ else // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { - print '' . $langs->trans( "Categories" ) . ''; + print '' . $langs->trans("Categories") . ''; print ''; print $form->showCategories( $object->id, 'contact', 1 ); print ''; @@ -1141,7 +1141,7 @@ else if (! empty($conf->propal->enabled)) { - print ''.$langs->trans("ContactForProposals").''; + print ''.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print ''; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 8566b4e5585..c10d2b508dc 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -554,8 +554,6 @@ class Contact extends CommonObject $this->db->rollback(); return -$error; } - - return $result; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5feafcbb6b3..03e62523922 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -151,12 +151,12 @@ if ($action == 'edit') print ''; // Ref - print ''; // Photo - print ''; // Name - print ''; - print ''; + print ''; + print ''; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index ccb3d1d314c..9e3d5425eb5 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1950,6 +1950,13 @@ else else print ''; } + if (! empty($conf->commande->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + { + $langs->load("bills"); + if ($user->rights->facture->creer) print ''; + else print ''; + } + if ($object->nbofservicesclosed < $nbofservices) { //if (! $numactive) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 578a1888ecb..ba2c60fc013 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2015 Juanjo Menent + * Copyright (C) 2010-2016 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García @@ -2179,6 +2179,7 @@ class Contrat extends CommonObject $this->ref_supplier = 'SPECIMENSUPP'; $this->socid = 1; $this->statut= 0; + $this->date_creation = (dol_now() - 3600 * 24 * 7); $this->date_contrat = dol_now(); $this->commercial_signature_id = 1; $this->commercial_suivi_id = 1; @@ -2458,7 +2459,6 @@ class ContratLigne extends CommonObjectLine */ function fetch($id, $ref='') { - global $langs,$user; // Check parameters if (empty($id) && empty($ref)) return -1; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 86f7c00e566..2a2d2d35891 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -344,7 +344,7 @@ if ($result) $staticcompany->name=$obj->name; print $staticcompany->getNomUrl(1,'',20); print ''; - print ''; + print ''; //print ''; print ''; print ''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cd0c934ead2..72c852b10fc 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -30,13 +30,26 @@ require ("../main.inc.php"); require_once (DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $langs->load("contracts"); $langs->load("products"); $langs->load("companies"); $langs->load("compta"); +$action=GETPOST('action','alpha'); +$massaction=GETPOST('massaction','alpha'); +$show_files=GETPOST('show_files','int'); +$confirm=GETPOST('confirm','alpha'); +$toselect = GETPOST('toselect', 'array'); + $search_name=GETPOST('search_name'); +$search_town=GETPOST('search_town','alpha'); +$search_zip=GETPOST('search_zip','alpha'); +$search_state=trim(GETPOST("search_state")); +$search_country=GETPOST("search_country",'int'); +$search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_contract=GETPOST('search_contract'); $search_ref_supplier=GETPOST('search_ref_supplier','alpha'); $sall=GETPOST('sall'); @@ -45,6 +58,9 @@ $socid=GETPOST('socid'); $search_user=GETPOST('search_user','int'); $search_sale=GETPOST('search_sale','int'); $search_product_category=GETPOST('search_product_category','int'); +$day=GETPOST("day","int"); +$year=GETPOST("year","int"); +$month=GETPOST("month","int"); $optioncss = GETPOST('optioncss','alpha'); @@ -69,6 +85,7 @@ $staticcontratligne=new ContratLigne($db); if ($search_status == '') $search_status=1; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $contextpage='contractlist'; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array @@ -76,9 +93,8 @@ $hookmanager->initHooks(array($contextpage)); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('contract'); +$extralabels = $extrafields->fetch_name_optionals_label('contrat'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); - // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'c.ref'=>'Ref', @@ -90,25 +106,56 @@ $fieldstosearchall = array( ); if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; +$arrayfields=array( + 'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1), + 'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1), + 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), + 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), + 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), + 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), + 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), + 'sale_representative'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1), + 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1), + 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), +); +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } +} + /* * Action */ -$parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; -if (empty($reshook)) +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { - -} - -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $search_name=""; + $day=''; + $month=''; + $year=''; + $search_name=""; + $search_town=''; + $search_zip=""; + $search_state=""; + $search_type=''; + $search_country=''; $search_contract=""; $search_ref_supplier=""; $search_user=''; @@ -116,9 +163,20 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_product_category=''; $sall=""; $search_status=""; + $toselect=''; $search_array_options=array(); } +if (empty($reshook)) +{ + $objectclass='Contrat'; + $objectlabel='Contracts'; + $permtoread = $user->rights->contrat->lire; + $permtodelete = $user->rights->contrat->supprimer; + $uploaddir = $conf->contrat->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + /* * View @@ -132,16 +190,28 @@ $socstatic = new Societe($db); llxHeader(); $sql = 'SELECT'; -$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier,"; -$sql.= " s.nom as name, s.rowid as socid,"; +$sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier,"; +$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql.= " typent.code as typent_code,"; +$sql.= " state.code_departement as state_code, state.nom as state_name,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; $sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed'; +// Add fields from extrafields +foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contrat_extrafields as ef on (c.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product'; if ($search_user > 0) @@ -154,32 +224,68 @@ $sql.= ' AND c.entity IN ('.getEntity('contract', 1).')'; if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category; if ($socid) $sql.= " AND s.rowid = ".$db->escape($socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - -if ($search_name) { - $sql .= natural_search('s.nom', $search_name); +if ($month > 0) +{ + if ($year > 0 && empty($day)) + $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + else + $sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'"; } -if ($search_contract) { - $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); -} -if (!empty($search_ref_supplier)) { - $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); +else if ($year > 0) +{ + $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } +if ($search_name) $sql .= natural_search('s.nom', $search_name); +if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); +if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); if ($search_sale > 0) { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; } -if ($sall) { - $sql .= natural_search(array_keys($fieldstosearchall), $sall); -} +if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; -$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, s.nom, s.rowid"; +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; + +$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier,"; +$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql.= " typent.code,"; +$sql.= " state.code_departement, state.nom"; +// Add where from extra fields +foreach ($extrafields->attribute_label as $key => $val) +{ + $sql .= ', ef.'.$val; +} +// Add where from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; + +$sql.= $db->order($sortfield,$sortorder); + $totalnboflines=0; $result=$db->query($sql); if ($result) { $totalnboflines = $db->num_rows($result); } -$sql.= $db->order($sortfield,$sortorder); $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -196,23 +302,46 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; + $arrayofselected=is_array($toselect)?$toselect:array(); + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - $param.='&search_contract='.$search_contract; - $param.='&search_name='.$search_name; - $param.='&search_ref_supplier='.$search_ref_supplier; - $param.='&search_sale=' .$search_sale; - if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($search_contract) $param.='&search_contract='.$search_contract; + if ($search_name) $param.='&search_name='.$search_name; + if ($search_ref_supplier) $param.='&search_ref_supplier='.$search_ref_supplier; + if ($search_sale) $param.='&search_sale=' .$search_sale; + if ($show_files) $param.='&show_files=' .$show_files; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + // List of mass actions available + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + if ($user->rights->contrat->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete"); + if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + + print ''; if ($optioncss != '') print ''; print ''; + print ''; print ''; print ''; print ''; - print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,$totalnboflines,'title_commercial.png', 0, '', '', $limit); + print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); if ($sall) { @@ -220,8 +349,9 @@ if ($resql) print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - // If the user can view prospects other than his' $moreforfilter=''; + + // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); @@ -253,6 +383,7 @@ if ($resql) $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; + if (! empty($moreforfilter)) { print '
'; @@ -260,43 +391,164 @@ if ($resql) print '
'; } - print '
'.$langs->trans("Ref").''; + print '
'.$langs->trans("Ref").''; print $object->id; print ''; + print ''; print $form->showphoto('contact',$object)."\n"; if ($object->photo) print "
\n"; @@ -170,8 +170,8 @@ if ($action == 'edit') print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.'
'.$langs->trans("Firstname").''.$object->firstname.''.dol_print_date($obj->tms,'dayhour').''.dol_print_date($db->jdate($obj->tms),'dayhour').''.$staticcontrat->LibStatut($obj->statut,2).''.($obj->nb_initial>0 ? $obj->nb_initial.$staticcontratligne->LibStatut(0,3):'').''.($obj->nb_running>0 ? $obj->nb_running.$staticcontratligne->LibStatut(4,3,0):'').'
'; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'."\n"; print ''; - - print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("RefSupplier"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("SalesRepresentative"), $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"], "c.statut","","$param",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"'); - print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); + if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder); + if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); + if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); + if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); + if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); + if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['status']['checked'])) + { + print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"'); + } + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + } + if (! empty($arrayfields['c.ref_customer']['checked'])) + { + print ''; + } + if (! empty($arrayfields['c.ref_supplier']['checked'])) + { + print ''; + } + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + } + // Town + if (! empty($arrayfields['s.town']['checked'])) print ''; + // Zip + if (! empty($arrayfields['s.zip']['checked'])) print ''; + // State + if (! empty($arrayfields['state.nom']['checked'])) + { + print ''; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + } + // Company type + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + } + if (! empty($arrayfields['sale_representative']['checked'])) + { + print ''; + } + if (! empty($arrayfields['c.date_contrat']['checked'])) + { + // Date contract + print ''; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['c.datec']['checked'])) + { + print ''; + } + // Date modification + if (! empty($arrayfields['c.tms']['checked'])) + { + print ''; + } + // Status + if (! empty($arrayfields['status']['checked'])) + { + print ''; + } + print ''; print "\n"; @@ -306,65 +558,166 @@ if ($resql) $obj = $db->fetch_object($resql); $var=!$var; print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - - // Sales Rapresentatives - print ''; } - else + if (! empty($arrayfields['c.ref_customer']['checked'])) { - print ' '; + print ''; + } + if (! empty($arrayfields['c.ref_supplier']['checked'])) + { + print ''; + } + if (! empty($arrayfields['s.nom']['checked'])) + { + print ''; + } + // Town + if (! empty($arrayfields['s.town']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Zip + if (! empty($arrayfields['s.zip']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // State + if (! empty($arrayfields['state.nom']['checked'])) + { + print "\n"; + if (! $i) $totalarray['nbfield']++; + } + // Country + if (! empty($arrayfields['country.code_iso']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Type ent + if (! empty($arrayfields['typent.code']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + if (! empty($arrayfields['sale_representative']['checked'])) + { + // Sales representatives + print ''; + } + // Date + if (! empty($arrayfields['c.date_contrat']['checked'])) + { + print ''; + } + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + print 'getAlignFlag($key); + if ($align) print ' align="'.$align.'"'; + print '>'; + $tmpkey='options_'.$key; + print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + } + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Date creation + if (! empty($arrayfields['c.datec']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Date modification + if (! empty($arrayfields['c.tms']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Status + if (! empty($arrayfields['status']['checked'])) + { + print ''; + print ''; + print ''; + print ''; + } + // Action column + print ''; - - - print ''; - //print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + if (! $i) $totalarray['nbfield']++; + print "\n"; $i++; } diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 40cc8885f90..fe864e1df16 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -1,6 +1,7 @@ - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2010 Regis Houssin + * Copyright (C) 2015 Frederic France + * Copyright (C) 2016 Laurent Destailleur * * 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 @@ -71,7 +72,8 @@ class box_contracts extends ModeleBoxes $sql.= " AND c.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; - $sql.= " ORDER BY c.date_contrat DESC, c.ref DESC "; + if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql.= " ORDER BY c.date_contrat DESC, c.ref DESC "; + else $sql.= " ORDER BY c.tms DESC, c.ref DESC "; $sql.= $db->plimit($max, 0); $resql = $db->query($sql); diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 29db63054e5..f2bc86cdac5 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -68,6 +68,7 @@ class box_services_expired extends ModeleBoxes $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE cd.statut = 4 AND cd.date_fin_validite <= '".$db->idate($now)."'"; + $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_soc=s.rowid AND cd.fk_contrat=c.rowid AND c.statut > 0"; if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 877f40f6b79..0f754682925 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -251,6 +251,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" $out.= $s; } $out.= ' '; + $sublink=''; if (! empty($head['sublink'])) $sublink.= ''; if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 52f476e857e..07195cf0d50 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -601,13 +601,13 @@ abstract class CommonObject $datecreate = dol_now(); $this->db->begin(); - + // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact"; $sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) "; $sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ; $sql.= "'".$this->db->idate($datecreate)."'"; - $sql.= ", 4, '". $id_type_contact . "' "; + $sql.= ", 4, ". $id_type_contact; $sql.= ")"; $resql=$this->db->query($sql); @@ -4508,7 +4508,7 @@ abstract class CommonObject if (! $db->query($sql)) { - if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B. + if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B. //$this->errors = $db->lasterror(); return false; } diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 3ac15c7a8c8..4b7e2a3d79b 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -51,7 +51,7 @@ class Conf public $standard_menu; public $modules = array(); // List of activated modules - public $modules_parts = array('css'=>array(),'js'=>array(),'tabs'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'sms'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'societe'=>array(),'hooks'=>array(),'dir'=>array()); + public $modules_parts = array('css'=>array(),'js'=>array(),'tabs'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'sms'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'societe'=>array(),'hooks'=>array(),'dir'=>array(), 'syslog' =>array()); var $logbuffer = array(); @@ -123,6 +123,8 @@ class Conf */ function setValues($db) { + global $conf; + dol_syslog(get_class($this)."::setValues"); /* @@ -203,7 +205,7 @@ class Conf $db->free($resql); } - + // Include other local consts.php files and fetch their values to the corresponding database constants if (! empty($this->global->LOCAL_CONSTS_FILES)) { $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); @@ -342,7 +344,7 @@ class Conf $this->fournisseur->facture=new stdClass(); $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; - + // To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties { @@ -379,7 +381,7 @@ class Conf // Set some default values $this->global->MAIN_ACTIVATE_HTML5=1; - + // societe if (empty($this->global->SOCIETE_CODECLIENT_ADDON)) $this->global->SOCIETE_CODECLIENT_ADDON="mod_codeclient_leopard"; if (empty($this->global->SOCIETE_CODECOMPTA_ADDON)) $this->global->SOCIETE_CODECOMPTA_ADDON="mod_codecompta_panicum"; @@ -483,10 +485,10 @@ class Conf // By default, we propagate contacts if (! isset($this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN)) $this->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN='*'; // Can be also '*' or '^(BILLING|SHIPPING|CUSTOMER|.*)$' (regex not yet implemented) - + // By default, we use the zip town autofill if (! isset($this->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) $this->global->MAIN_USE_ZIPTOWN_DICTIONNARY=1; - + // Define list of limited modules if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,supplier_proposal,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later. @@ -510,13 +512,13 @@ class Conf $this->adherent->cotisation->warning_delay=(isset($this->global->MAIN_DELAY_MEMBERS)?$this->global->MAIN_DELAY_MEMBERS:0)*24*60*60; } if (isset($this->agenda)) $this->agenda->warning_delay=(isset($this->global->MAIN_DELAY_ACTIONS_TODO)?$this->global->MAIN_DELAY_ACTIONS_TODO:7)*24*60*60; - if (isset($this->projet)) + if (isset($this->projet)) { $this->projet->warning_delay=(isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE)?$this->global->MAIN_DELAY_PROJECT_TO_CLOSE:7)*24*60*60; $this->projet->task = new StdClass(); $this->projet->task->warning_delay=(isset($this->global->MAIN_DELAY_TASKS_TODO)?$this->global->MAIN_DELAY_TASKS_TODO:7)*24*60*60; } - + if (isset($this->commande)) { $this->commande->client = new stdClass(); $this->commande->fournisseur = new stdClass(); @@ -570,26 +572,40 @@ class Conf if (is_object($mc)) $mc->setValues($this); } - // We init log handlers - if (defined('SYSLOG_HANDLERS')) $handlers = json_decode(constant('SYSLOG_HANDLERS')); - else $handlers = array(); - foreach ($handlers as $handler) - { - $file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php'; - if (!file_exists($file)) - { - throw new Exception('Missing log handler file '.$handler.'.php'); - } + // We init log handlers + if (defined('SYSLOG_HANDLERS')) { + $handlers = json_decode(constant('SYSLOG_HANDLERS')); + } else { + $handlers = array(); + } + foreach ($handlers as $handler) { + $handler_files = array(); + $dirsyslogs = array_merge(array('/core/modules/syslog/'), $conf->modules_parts['syslog']); + foreach ($dirsyslogs as $reldir) { + $dir = dol_buildpath($reldir, 0); + $newdir = dol_osencode($dir); + if (is_dir($newdir)) { + $file = $newdir . $handler . '.php'; + if (file_exists($file)) { + $handler_files[] = $file; + } + } + } - require_once $file; - $loghandlerinstance = new $handler(); - if (!$loghandlerinstance instanceof LogHandlerInterface) - { - throw new Exception('Log handler does not extend LogHandlerInterface'); - } + if (empty($handler_files)) { + throw new Exception('Missing log handler file ' . $handler . '.php'); + } - if (empty($this->loghandlers[$handler])) $this->loghandlers[$handler]=$loghandlerinstance; - } + require_once $handler_files[0]; + $loghandlerinstance = new $handler(); + if (!$loghandlerinstance instanceof LogHandlerInterface) { + throw new Exception('Log handler does not extend LogHandlerInterface'); + } + + if (empty($this->loghandlers[$handler])) { + $this->loghandlers[$handler] = $loghandlerinstance; + } + } } } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index e256dbfb649..9a59801f720 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -66,6 +66,8 @@ class DiscountAbsolute */ function fetch($rowid,$fk_facture_source=0) { + global $conf; + // Check parameters if (! $rowid && ! $fk_facture_source) { @@ -81,9 +83,9 @@ class DiscountAbsolute $sql.= " f.facnumber as ref_facture_source"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid"; - $sql.= " WHERE"; - if ($rowid) $sql.= " sr.rowid=".$rowid; - if ($fk_facture_source) $sql.= " sr.fk_facture_source=".$fk_facture_source; + $sql.= " WHERE sr.entity = " . $conf->entity; + if ($rowid) $sql.= " AND sr.rowid=".$rowid; + if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); @@ -150,11 +152,11 @@ class DiscountAbsolute // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except"; - $sql.= " (datec, fk_soc, fk_user, description,"; + $sql.= " (entity, datec, fk_soc, fk_user, description,"; $sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,"; $sql.= " fk_facture_source"; $sql.= ")"; - $sql.= " VALUES ('".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; + $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; $sql.= " ".($this->fk_facture_source?"'".$this->fk_facture_source."'":"null"); $sql.= ")"; @@ -343,10 +345,13 @@ class DiscountAbsolute */ function getAvailableDiscounts($company='', $user='',$filter='', $maxvalue=0) { + global $conf; + $sql = "SELECT SUM(rc.amount_ttc) as amount"; // $sql = "SELECT rc.amount_ttc as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; - $sql.= " WHERE (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available + $sql.= " WHERE rc.entity = " . $conf->entity; + $sql.= " AND (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available if (is_object($company)) $sql.= " AND rc.fk_soc = ".$company->id; if (is_object($user)) $sql.= " AND rc.fk_user = ".$user->id; if ($filter) $sql.=' AND ('.$filter.')'; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5e8f84f4d24..5b1b935d24d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -58,11 +58,12 @@ class ExtraFields var $attribute_perms; // Array to store permission to check var $attribute_list; - + // Array to store if extra field is hidden + var $attribute_hidden; // warning, do not rely on this. If your module need a hidden data, it must use its own table. + var $error; var $errno; - var $attribute_hidden; public static $type2label=array( 'varchar'=>'String', @@ -121,7 +122,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Into list view by default - * @param int $ishidden Is hidden extrafield + * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) * @return int <=0 if KO, >0 if OK */ function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param=0, $alwayseditable=0, $perms='', $list=0, $ishidden=0) @@ -252,7 +253,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Into list view by default - * @param int $ishidden Is hidden extrafield + * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) * @return int <=0 if KO, >0 if OK */ private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=0, $ishidden=0) @@ -400,7 +401,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Into list view by default - * @param int $ishidden Is hidden extrafield + * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) * @return int >0 if OK, <=0 if KO */ function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0, $perms='',$list='',$ishidden=0) @@ -498,7 +499,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Into list view by default - * @param int $ishidden Is hidden extrafield + * @param int $ishidden Is hidden extrafield (warning, do not rely on this. If your module need a hidden data, it must use its own table) * @return int <=0 if KO, >0 if OK */ private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0) @@ -1188,7 +1189,7 @@ class ExtraFields $params=$this->attribute_param[$key]; $perms=$this->attribute_perms[$key]; $list=$this->attribute_list[$key]; - $hidden=$this->attribute_hidden[$key]; + $hidden=$this->attribute_hidden[$key]; // warning, do not rely on this. If your module need a hidden data, it must use its own table. $showsize=0; if ($type == 'date') @@ -1261,7 +1262,14 @@ class ExtraFields { $sql.= ' as main'; } - $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; + if ($selectkey=='rowid' && empty($value)) { + $sql.= " WHERE ".$selectkey."=0"; + } elseif ($selectkey=='rowid') { + $sql.= " WHERE ".$selectkey."=".$this->db->escape($value); + }else { + $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; + } + //$sql.= ' AND entity = '.$conf->entity; dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c1990199f54..f9eb5ff07d1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -449,7 +449,7 @@ class Form * @param string $text Text to show * @param string $htmltext Content of tooltip * @param int $direction 1=Icon is after text, -1=Icon is before text, 0=no icon - * @param string $type Type of picto (info, help, warning, superadmin...) + * @param string $type Type of picto (info, help, warning, superadmin...) OR image filepath (mypicto@mymodule) * @param string $extracss Add a CSS style to td tags * @param int $noencodehtmltext Do not encode into html entity the htmltext * @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span @@ -487,6 +487,7 @@ class Form elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar'); elseif ($type == 'admin') $img = img_picto($alt, 'star'); elseif ($type == 'warning') $img = img_warning($alt); + else $img = img_picto($alt, $type); return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext); } @@ -1117,7 +1118,8 @@ class Form $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; $sql.= " re.description, re.fk_facture_source"; $sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re"; - $sql.= " WHERE fk_soc = ".(int) $socid; + $sql.= " WHERE re.fk_soc = ".(int) $socid; + $sql.= " AND re.entity = " . $conf->entity; if ($filter) $sql.= " AND ".$filter; $sql.= " ORDER BY re.description ASC"; @@ -5061,8 +5063,8 @@ class Form
'.img_picto('','list').' - +
@@ -5165,9 +5167,9 @@ class Form print '
'; print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, ''); - + print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ' '; - $searchpitco=$form->showFilterAndCheckAddButtons(0); - print $searchpitco; + if (! empty($arrayfields['c.ref']['checked'])) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; + //print $langs->trans('Month').': '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + //print ' '.$langs->trans('Year').': '; + $syear = $year; + $formother->select_year($syear,'year',1, 20, 5); + print ''; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; + print ''; + print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; print '
'; - print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .''; - if ($obj->nb_late) print img_warning($langs->trans("Late")); - print ''.$obj->ref_customer.''.$obj->ref_supplier.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''.dol_print_date($obj->datec).''; - if($obj->socid) + if (! empty($arrayfields['c.ref']['checked'])) { - $result=$socstatic->fetch($obj->socid); - if ($result < 0) - { - dol_print_error($db); - exit; - } - $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); - if ($listsalesrepresentatives < 0) dol_print_error($db); - $nbofsalesrepresentative=count($listsalesrepresentatives); - if ($nbofsalesrepresentative > 3) // We print only number - { - print ''; - print $nbofsalesrepresentative; - print ''; - } - else if ($nbofsalesrepresentative > 0) - { - $userstatic=new User($db); - $j=0; - foreach($listsalesrepresentatives as $val) - { - $userstatic->id=$val['id']; - $userstatic->lastname=$val['lastname']; - $userstatic->firstname=$val['firstname']; - print '
'.$userstatic->getNomUrl(1); - $j++; - if ($j < $nbofsalesrepresentative) print ', '; - print '
'; - } - } - //else print $langs->trans("NoSalesRepresentativeAffected"); + print '
'; + print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->rowid) .''; + if ($obj->nb_late) print img_warning($langs->trans("Late")); + print ''.$obj->ref_customer.''.$obj->ref_supplier.''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; + print $obj->town; + print ''; + print $obj->zip; + print '".$obj->state_name."'; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; + print ''; + if ($obj->socid > 0) + { + $result=$socstatic->fetch($obj->socid); + $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) dol_print_error($db); + $nbofsalesrepresentative=count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 3) // We print only number + { + print ''; + print $nbofsalesrepresentative; + print ''; + } + else if ($nbofsalesrepresentative > 0) + { + $userstatic=new User($db); + $j=0; + foreach($listsalesrepresentatives as $val) + { + $userstatic->id=$val['id']; + $userstatic->lastname=$val['lastname']; + $userstatic->firstname=$val['firstname']; + print '
'.$userstatic->getNomUrl(1); + $j++; + if ($j < $nbofsalesrepresentative) print ', '; + print '
'; + } + } + //else print $langs->trans("NoSalesRepresentativeAffected"); + } + else + { + print ' '; + } + print '
'.dol_print_date($db->jdate($obj->date_contrat), 'day').''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour'); + print ''.($obj->nb_initial>0?$obj->nb_initial:'').''.($obj->nb_running>0?$obj->nb_running:'').''.($obj->nb_expired>0?$obj->nb_expired:'').''.($obj->nb_closed>0 ?$obj->nb_closed:'').''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; } print ''.dol_print_date($db->jdate($obj->date_contrat)).''.$staticcontrat->LibStatut($obj->statut,3).''.($obj->nb_initial>0?$obj->nb_initial:'').''.($obj->nb_running>0?$obj->nb_running:'').''.($obj->nb_expired>0?$obj->nb_expired:'').''.($obj->nb_closed>0 ?$obj->nb_closed:'').'
'; - + print ''; print ''; print ''; @@ -5177,9 +5179,9 @@ class Form print ''; print ''; print ''; - + $numoutput=0; - + foreach($object->linkedObjects as $objecttype => $objects) { $tplpath = $element = $subelement = $objecttype; @@ -5239,7 +5241,7 @@ class Form foreach($dirtpls as $reldir) { $res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php'); - if ($res) + if ($res) { $numoutput++; break; @@ -5251,7 +5253,7 @@ class Form { print ''; } - + print '
'.$langs->trans("Type").''.$langs->trans("Ref").''.$langs->trans("Status").'
'.$langs->trans("None").'
'; return $num; @@ -5260,7 +5262,7 @@ class Form /** * Show block with links to link to other objects. - * + * * @param CommonObject $object Object we want to show links to * @param array $restrictlinksto Restrict links to some elements, for exemple array('order') or array('supplier_order'). null or array() if no restriction. * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. @@ -5285,12 +5287,12 @@ class Form 'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id), 'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id) ); - + foreach($possiblelinks as $key => $possiblelink) { $num = 0; - + if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto))) { print '
global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>'; @@ -5300,7 +5302,7 @@ class Form { $num = $this->db->num_rows($resqllist); $i = 0; - + print '
'; print ''; print ''; @@ -5316,7 +5318,7 @@ class Form while ($i < $num) { $objp = $this->db->fetch_object($resqlorderlist); - + $var = ! $var; print ''; print ''; @@ -5331,7 +5333,7 @@ class Form } print ''; print '
     
'; - + print ''; $this->db->free($resqllist); } else { @@ -5340,8 +5342,8 @@ class Form print '
'; if ($num > 0) { - } - + } + //$linktoelem.=($linktoelem?'   ':''); if ($num > 0) $linktoelem.='
  • ' . $langs->trans($possiblelink['label']) .' ('.$num.')
  • '; //else $linktoelem.=$langs->trans($possiblelink['label']); @@ -5359,7 +5361,7 @@ class Form '; - + print ' '; - + return $linktoelem; } @@ -5474,15 +5476,15 @@ class Form * @param string $paramid Name of parameter to use to name the id into the URL next/previous link * @param string $morehtml More html content to output just before the nav bar * @param int $shownav Show Condition (navigation is shown if value is 1) - * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field) - * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous + * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field) + * @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref. * @param string $morehtmlref More html to show after ref * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref * @param string $morehtmlstatus More html code to show under navigation arrows (status place) * @param string $morehtmlright More html code to show after ref - * @return string Portion HTML avec ref + boutons nav + * @return string Portion HTML with ref + navigation buttons */ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') { @@ -5507,7 +5509,7 @@ class Form $ret.='
    '; - // For thirdparty and contact, the ref is the id, so we show something else + // For thirdparty, contact, user, member, the ref is the id, so we show something else if ($object->element == 'societe') { $ret.=dol_htmlentities($object->name); @@ -5516,7 +5518,7 @@ class Form { $ret.=dol_htmlentities($object->getFullName($langs)); } - else $ret.=dol_htmlentities($object->$fieldref); + else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) { $ret.=' '.$morehtmlref; @@ -5666,7 +5668,7 @@ class Form { if ($file && file_exists($dir."/".$file)) { - if ($addlinktofullsize) + if ($addlinktofullsize) { $urladvanced=getAdvancedPreviewUrl($modulepart, $originalfile); if ($urladvanced) $ret.=''; @@ -5677,7 +5679,7 @@ class Form } else if ($altfile && file_exists($dir."/".$altfile)) { - if ($addlinktofullsize) + if ($addlinktofullsize) { $urladvanced=getAdvancedPreviewUrl($modulepart, $originalfile); if ($urladvanced) $ret.=''; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 33393f1ef46..16a16719366 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -51,14 +51,14 @@ class FormAdmin * @param string $htmlname Name of HTML select * @param int $showauto Show 'auto' choice * @param array $filter Array of keys to exclude in list - * @param int $showempty Add empty value + * @param string $showempty 1=Add empty value or string to show * @param int $showwarning Show a warning if language is not complete * @param int $disabled Disable edit of select * @param string $morecss Add more css styles * @param int $showcode Add language code into label * @return string Return HTML select string with list of languages */ - function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=null,$showempty=0,$showwarning=0,$disabled=0,$morecss='',$showcode=0) + function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0) { global $langs; @@ -71,7 +71,10 @@ class FormAdmin { $out.= 'dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1'; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'">1'; if ($cpt > 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; - else if ($cpt == 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">2'; + else if ($cpt == 2) $pagelist.='dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=1'.$options.'">2'; } do @@ -3119,7 +3119,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so } else { - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).''; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'">'.($cpt+1).''; } $cpt++; } @@ -3128,8 +3128,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so if ($cpt<$nbpages) { if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; - else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($nbpages - 1).''; - $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.''; + else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-2).$options.'">'.($nbpages - 1).''; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'">'.$nbpages.''; } } else @@ -3149,7 +3149,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so * * @param int $page Number of page * @param string $file Page URL (in most cases provided with $_SERVER["PHP_SELF"]) - * @param string $options Other url paramaters to propagate ("" by default) + * @param string $options Other url paramaters to propagate ("" by default, may include sortfield and sortorder) * @param integer $nextpage Do we show a next page button * @param string $betweenarrows HTML content to show between arrows. MUST contains '
  • ' tags or '
  • '. * @param string $afterarrows HTML content to show after arrows. Must NOT contains '
  • ' tags. diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index a3e2a3aa65d..a6fa6839fb8 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1579,7 +1579,8 @@ function getListOfModels($db,$type,$maxfilenamelength=0) /** * This function evaluates a string that should be a valid IPv4 - * + * Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patchs of PHP (5.6.25). See https://github.com/php/php-src/pull/1954. + * * @param string $ip IP Address * @return int 0 if not valid or reserved range, 1 if valid and public IP, 2 if valid and private range IP */ diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 2785a0aeafc..7731c7473e5 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -59,6 +59,9 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea if (count($addheaders)) curl_setopt($ch, CURLOPT_HTTPHEADER, $addheaders); curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it + // TLSv1 by default or change to TLSv1.2 in module configuration + //curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->MAIN_CURL_SSLVERSION)?1:$conf->global->MAIN_CURL_SSLVERSION)); + //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index f947caf5609..f48a248ab14 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -39,7 +39,7 @@ function facture_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/facture.php?facid='.$object->id; - $head[$h][1] = $langs->trans('CardBill'); + $head[$h][1] = $langs->trans('Card'); $head[$h][2] = 'compta'; $h++; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index b8ddc9545e3..9b90821883f 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -37,7 +37,7 @@ function member_prepare_head(Adherent $object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id; - $head[$h][1] = $langs->trans("MemberCard"); + $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 9a1ba356969..2319b52c2b1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1846,6 +1846,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0) * @param string $type Type * @param Translate $outputlangs Object langs for output * @return integer + * @deprecated Not used by Dolibarr core, so will be removed. */ function pdf_getTotalQty($object,$type,$outputlangs) { diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index a32805b6169..dc73c70b4ba 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -106,6 +106,7 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod sleep(1); $langs->load('main'); $langs->load('other'); + $langs->load('errors'); $_SESSION["dol_loginmesg"]=$langs->trans("ErrorFailedToLoadLoginFileForMode",$mode); } } diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 203316ce111..740bb223cba 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -41,7 +41,7 @@ function tax_prepare_head(ChargeSociales $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$object->id; $head[$h][1] = $langs->trans('Card'); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 1682f8d0887..8d442086d64 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -202,8 +202,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left --insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'accountancy', '', 2220__+MAX_llx_menu__, '/loan/calc.php?leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'accountancy', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/index.php?leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/charges.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'accountancy', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'accountancy', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); @@ -285,6 +285,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +-- Project - Categories +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); @@ -329,9 +332,14 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?select_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?&action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?&action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__); --- HRM - Expense reports +-- HRM - Trips and expenses (old module) insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__); - +-- HRM - Expense reports +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->rights->expensereport->lire', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?action=create&leftmenu=expensereport', 'New', 1, 'trips', '$user->rights->expensereport->creer', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?leftmenu=expensereport', 'List', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?search_status=2&leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->rights->expensereport->approve', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 736f2a72380..5402ac5bbd1 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -177,7 +177,11 @@ class MenuManager // We add sub entry print str_pad('',1).'
  • '; // ui-btn to highlight on clic print ''; - if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") print $langs->trans("Access"); // No translation + if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") // No translation + { + if ($val['mainmenu'] == 'cashdesk') print $langs->trans("Access"); + else print $langs->trans("Dashboard"); + } else print $langs->trans(ucfirst($val['mainmenu'])."Dashboard"); print ''; print '
  • '."\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 68917a8ba89..f186a45b6dd 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -57,13 +57,13 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $showmode=1; $classname = 'class="tmenu menuhider"'; $idsel='menu'; - + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry('', 1, '#', $id, $idsel, $classname, $atarget); if (empty($noout)) print_end_menu_entry($showmode); $menu->add('#', '', 0, $showmode, $atarget, "xxx", ''); } - + // Home $showmode=1; $classname=""; @@ -132,8 +132,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode if (! empty($conf->contrat->enabled)) $menuqualified++; if (! empty($conf->ficheinter->enabled)) $menuqualified++; $tmpentry=array( - 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)), + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->societe->contact->lire)), 'module'=>'propal|commande|supplier_order|contrat|ficheinter'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -343,7 +343,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode function print_start_menu_array() { global $conf; - + print '
    '; print '
      global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>'; } @@ -488,7 +488,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print '
    '."\n"; print "\n"; } - + /** * We update newmenu with entries found into database * -------------------------------------------------- @@ -504,7 +504,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu // Home - dashboard $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("Dashboard"), 0, 1, '', $mainmenu, 'home'); - + // Setup $newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup'); if (empty($leftmenu) || $leftmenu=="setup") @@ -528,7 +528,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1); $newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1); $newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1); - + $newmenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"),1); $newmenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"),1); $newmenu->add("/admin/delais.php?mainmenu=home",$langs->trans("Alerts"),1); @@ -568,7 +568,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/admin/tools/listsessions.php?mainmenu=home&leftmenu=admintools", $langs->trans("Sessions"),1); $newmenu->add('/admin/system/about.php?mainmenu=home&leftmenu=admintools', $langs->trans('About'), 1); - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $langs->load("products"); $newmenu->add("/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools", $langs->trans("ProductVatMassChange"), 1, $user->admin); @@ -579,7 +579,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("accountancy"); $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=home&leftmenu=admintools", $langs->trans("InitAccountancy"), 1, $user->admin); } - + $newmenu->add("/support/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("HelpCenter"),1,1,'targethelp'); } @@ -747,7 +747,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=6,7", $langs->trans("StatusOrderCanceled"), 2, $user->rights->fournisseur->commande->lire); if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&statut=9", $langs->trans("StatusOrderRefused"), 2, $user->rights->fournisseur->commande->lire); // Billed is another field. We should add instead a dedicated filter on list. if (empty($leftmenu) || $leftmenu=="orders_suppliers") $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers&billed=1", $langs->trans("StatusOrderBilled"), 2, $user->rights->fournisseur->commande->lire); - + $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } @@ -773,7 +773,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 2200); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201); $newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202); - + $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } @@ -876,9 +876,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->tax->enabled)) { $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); - if (empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); + if (empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/card.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); if (empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"),2,$user->rights->tax->charges->lire); - if (empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/charges/index.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); + if (empty($leftmenu) || preg_match('/^tax_social/i',$leftmenu)) $newmenu->add("/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire); // VAT if (empty($conf->global->TAX_DISABLE_VAT_MENUS)) { @@ -910,7 +910,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } } - + // Salaries if (! empty($conf->salaries->enabled)) { @@ -919,7 +919,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/card.php?leftmenu=tax_salary&action=create",$langs->trans("NewPayment"),2,$user->rights->salaries->write); if (empty($leftmenu) || preg_match('/^tax_salary/i',$leftmenu)) $newmenu->add("/compta/salaries/index.php?leftmenu=tax_salary",$langs->trans("Payments"),2,$user->rights->salaries->read); } - + // Loan if (! empty($conf->loan->enabled)) { @@ -1212,6 +1212,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/projet/tasks/list.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/activity/perweek.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->lire); } + + // Categories + if (! empty($conf->categorie->enabled)) + { + $langs->load("categories"); + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + $newmenu->add("/categories/card.php?action=create&type=6", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); + //if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->rights->categorie->lire); + } } } @@ -1253,6 +1262,17 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire); $newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire); } + + // Expense report + if (! empty($conf->expensereport->enabled)) + { + $langs->load("trips"); + $newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport'); + $newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer); + $newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire); + $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->expensereport->approve); + $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire); + } } @@ -1338,7 +1358,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $menuArbo = new Menubase($db,'eldy'); $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,(empty($user->societe_id)?0:1),'eldy',$tabMenu); //var_dump($newmenu->liste); // - + // We update newmenu for special dynamic menus if (!empty($user->rights->banque->lire) && $mainmenu == 'bank') // Entry for each bank account { @@ -1410,7 +1430,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $nbentry = count($menu_array); while (findNextEntryForLevel($menu_array, $cursor, $position, $level)) { - + $cursor++; }*/ @@ -1431,7 +1451,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $altok++; $blockvmenuopened=true; $lastopened=true; - for($j = ($i + 1); $j < $num; $j++) + for($j = ($i + 1); $j < $num; $j++) { if (empty($menu_array[$j]['level'])) $lastopened=false; } @@ -1457,7 +1477,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } $url = $shorturl = $menu_array[$i]['url']; - + if (! preg_match("/^(http:\/\/|https:\/\/)/i",$menu_array[$i]['url'])) { $tmp=explode('?',$menu_array[$i]['url'],2); @@ -1465,11 +1485,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $param = (isset($tmp[1])?$tmp[1]:''); // params in url of the menu link // Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined. - if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu'])) + if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu'])) { $param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu='; } - if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($menu_array[$i]['mainmenu'])) + if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($menu_array[$i]['mainmenu'])) { $param.=($param?'&':'').'leftmenu='; } @@ -1477,12 +1497,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $url = dol_buildpath($url,1).($param?'?'.$param:''); $shorturl = $shorturl.($param?'?'.$param:''); } - + $url=preg_replace('/__LOGIN__/',$user->login,$url); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); $url=preg_replace('/__USERID__/',$user->id,$url); $shorturl=preg_replace('/__USERID__/',$user->id,$shorturl); - + print ''."\n"; // Menu niveau 0 @@ -1528,7 +1548,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($blockvmenuopened) { print '
    '."\n"; $blockvmenuopened=false; } } } - + if ($altok) print '
    '; } @@ -1541,7 +1561,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print ''."\n"; print "\n"; } - + return count($menu_array); } diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 0d43c0af9f9..5800e4b5d7a 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -185,7 +185,11 @@ class MenuManager print ''; - if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") print $langs->trans("Access"); // No translation + if ($langs->trans(ucfirst($val['mainmenu'])."Dashboard") == ucfirst($val['mainmenu'])."Dashboard") // No translation + { + if ($val['mainmenu'] == 'cashdesk') print $langs->trans("Access"); + else print $langs->trans("Dashboard"); + } else print $langs->trans(ucfirst($val['mainmenu'])."Dashboard"); print ''; print ''."\n"; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index a2828fb466a..a25c9918408 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -554,7 +554,7 @@ class pdf_strato extends ModelePDFContract $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_contrat,"day",false,$outputlangs,true), '', 'R'); if ($object->thirdparty->code_client) { diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index af51e01c576..60d99438f4f 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -207,6 +207,11 @@ class modAccounting extends DolibarrModules "chaine", "csv" ); + $this->const[24] = array( + "BANK_DISABLE_DIRECT_INPUT", + "yesno", + "1" + ); // Tabs $this->tabs = array(); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 17141b6200d..fcc931a9ed2 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -65,7 +65,7 @@ class modCategorie extends DolibarrModules // Config pages $this->config_page_url = array('categorie.php@categories'); - $this->langfiles = array("products","companies","categories"); + $this->langfiles = array("products","companies","categories","members"); // Constants $this->const = array(); @@ -182,7 +182,7 @@ class modCategorie extends DolibarrModules 'u.label' => "Label", 'u.description' => "Description", 'p.rowid' => 'ContactId', - 'p.civility' => 'Civility', + 'p.civility' => 'UserTitle', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname', 'p.address' => 'Address', diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 67dcc68b1e9..01110a66bf3 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -213,112 +213,6 @@ class modExpenseReport extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid'; $this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('expensereport',1).')'; - - - // Main menu entries - $this->menu = array(); // List of menus to add - $r=0; - - // Example to declare a Left Menu entry: fk_mainmenu=home,fk_leftmenu=admintools - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'TripsAndExpenses', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport', - 'url'=>'/expensereport/index.php', - 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detailnew', - 'url'=>'/expensereport/card.php?action=create', - 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->creer', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'List', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detaillist', - 'url'=>'/expensereport/list.php', - 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport_detaillist', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'ListToApprove', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detaillist_approve', - 'url'=>'/expensereport/list.php?search_status=2', - 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->approve', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'Statistics', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detail', - 'url'=>'/expensereport/stats/index.php', - 'langs'=>'trips', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->expensereport->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - - // Disabled, not yet stable - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'ExportTripCSV', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detail', - 'url'=>'/expensereport/export_csv.php', - 'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport', // Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry) - 'type'=>'left', // This is a Left menu entry - 'titre'=>'Synchro_Compta', - 'mainmenu'=>'hrm', - 'leftmenu'=>'expensereport_detail', - 'url'=>'/expensereport/synchro_compta.php', - 'langs'=>'expensereport', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->expensereport->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; } /** diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 8a6d537eb7a..d15215a4f99 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -192,9 +192,10 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export","other")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin', 'pj.ref'=>'ProjectRef', 'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.subprice'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancySellCode'); + //Add 'fd.label'=>"Label" to export_fields_array if you use it. Not used by dolibarr currently. //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text'); - $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text", 'pj.ref'=>'Text', 'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); + $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text", 'pj.ref'=>'Text', 'fd.label'=>'Text', 'fd.description'=>"Text",'fd.subprice'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice", 'pj.ref'=>'project', 'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.subprice'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user'); $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $keyforselect='facture'; $keyforelement='invoice'; $keyforaliasextra='extra'; @@ -225,7 +226,7 @@ class modFacture extends DolibarrModules $this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_icon[$r]='bill'; $this->export_permission[$r]=array(array("facture","facture","export")); - $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaiementMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef'); + $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'f.fk_user_author'=>'CreatedById','uc.login'=>'CreatedByLogin','f.fk_user_valid'=>'ValidatedById','uv.login'=>'ValidatedByLogin','pj.ref'=>'ProjectRef','p.rowid'=>'PaymentId','p.ref'=>'PaymentRef','p.amount'=>'AmountPayment','pf.amount'=>'AmountPaymentDistributedOnInvoice','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','pt.code'=>'IdPaymentMode','pt.libelle'=>'LabelPaymentMode','p.note'=>'PaymentNote','p.fk_bank'=>'IdTransaction','ba.ref'=>'AccountRef'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Numeric','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"Numeric",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pj.ref'=>'Text','p.amount'=>'Numeric','pf.amount'=>'Numeric','p.rowid'=>'Numeric','p.ref'=>'Text','p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','p.note'=>'Text','pt.code'=>'Text','pt.libelle'=>'text','ba.ref'=>'Text'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'pj.ref'=>'project','p.rowid'=>'payment','p.ref'=>'payment','p.amount'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment','pt.code'=>'payment','pt.libelle'=>'payment','p.note'=>'payment','f.fk_user_author'=>'user','uc.login'=>'user','f.fk_user_valid'=>'user','uv.login'=>'user','p.fk_bank'=>'account','ba.ref'=>'account'); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 174158ac7e2..f370c78b25e 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -44,13 +44,13 @@ class modHRM extends DolibarrModules $this->family = "hr"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace ( '/^mod/i', '', get_class ( $this ) ); - $this->description = "Gestion des ressources humaines"; + $this->name = preg_replace( '/^mod/i', '', get_class($this)); + $this->description = "Management of employees carrier and feelings"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'development'; - $this->const_name = 'MAIN_MODULE_' . strtoupper ( $this->name ); + $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; // $this->picto = ''; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 659ba30a0b9..c9f46012443 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -73,7 +73,7 @@ class modSalaries extends DolibarrModules $this->depends = array(); $this->requiredby = array(); $this->conflictwith = array(); - $this->langfiles = array("salaries"); + $this->langfiles = array("salaries","bills"); // Constants $this->const = array(); diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 48de5a48a6c..759b68555b7 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -68,7 +68,7 @@ class modUser extends DolibarrModules // Dependancies $this->depends = array(); $this->requiredby = array(); - $this->langfiles = array("main","users","companies"); + $this->langfiles = array("main","users","companies","members"); // Constants $this->const = array(); diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 27b0e0f779c..cc8699a4e84 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -25,6 +25,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; + use OAuth\Common\Storage\DoliStorage; use OAuth\Common\Consumer\Credentials; use OAuth\OAuth2\Service\Google; @@ -57,7 +58,7 @@ class printing_printgcp extends PrintingDriver */ function __construct($db) { - global $conf, $dolibarr_main_url_root; + global $conf, $langs, $dolibarr_main_url_root; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -66,7 +67,7 @@ class printing_printgcp extends PrintingDriver $this->db = $db; if (!$conf->oauth->enabled) { - $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>'ModuleAuthNotActive', 'type'=>'info'); + $this->conf[] = array('varname'=>'PRINTGCP_INFO', 'info'=>$langs->transnoentitiesnoconv("WarningModuleNotActive", "OAuth"), 'type'=>'info'); } else { $this->google_id = $conf->global->OAUTH_GOOGLE_ID; @@ -430,12 +431,13 @@ class printing_printgcp extends PrintingDriver //$html .= '
    '.print_r($responsedata,true).'
    '; $html .= ''; $html .= ''; - $html .= ""; - $html .= ""; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; $html .= ''."\n"; $var = True; $jobs = $responsedata['jobs']; @@ -447,6 +449,8 @@ class printing_printgcp extends PrintingDriver $var = !$var; $html .= ''; $html .= ''; + $dates=dol_print_date((int) substr($value['createTime'], 0, 10), 'dayhour'); + $html .= ''; $html .= ''; $html .= ''; $html .= ''; diff --git a/htdocs/core/modules/syslog/mod_syslog_sentry.php b/htdocs/core/modules/syslog/mod_syslog_sentry.php deleted file mode 100644 index fa5b61744cf..00000000000 --- a/htdocs/core/modules/syslog/mod_syslog_sentry.php +++ /dev/null @@ -1,195 +0,0 @@ - - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2015 Raphaël Doursenaud - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; -if (file_exists(DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php')) -{ - require_once DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php'; - Raven_Autoloader::register(); -} - -/** - * Class to manage logging to Sentry - * - * @see https://docs.getsentry.com/on-premise/clients/php/ - */ -class mod_syslog_sentry extends LogHandler implements LogHandlerInterface -{ - /** - * @var string Log handler code - */ - public $code = 'sentry'; - - /** - * Return name of logger - * - * @return string Name of logger - */ - public function getName() - { - return 'Sentry'; - } - - /** - * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development') - * - * @return string - */ - public function getVersion() - { - return 'dolibarr'; - } - - /** - * Content of the info tooltip. - * - * @return false|string - */ - public function getInfo() - { - global $langs; - return $langs->trans('SyslogSentryFromProject'); - } - - /** - * Is the module active ? - * - * @return boolean - */ - public function isActive() - { - return file_exists(DOL_DOCUMENT_ROOT.'/includes/raven/raven/lib/Raven/Autoloader.php'); - } - - /** - * Return array of configuration data - * - * @return array Return array of configuration data - */ - public function configure() - { - global $langs; - return array( - array( - 'constant' => 'SYSLOG_SENTRY_DSN', - 'name' => $langs->trans('SyslogSentryDSN'), - 'default' => '', - 'attr' => 'size="100" placeholder="https://:@app.getsentry.com/"' - ) - ); - } - - /** - * Return if configuration is valid - * - * @return array Array of errors. Empty array if ok. - */ - public function checkConfiguration() - { - global $conf; - - $errors = array(); - - $dsn = $conf->global->SYSLOG_SENTRY_DSN; - - try { - $client = new Raven_Client( - $dsn, - array('curl_method' => 'sync') - ); - } catch (InvalidArgumentException $ex) { - $errors[] = "ERROR: There was an error parsing your DSN:\n " . $ex->getMessage(); - } - - if (!$errors) { - // Send test event and check for errors - $client->captureMessage('TEST: Sentry syslog configuration check', null, Raven_Client::DEBUG); - $last_error = $client->getLastError(); - if ($last_error) { - $errors[] = $last_error; - } - } - - if (!$errors) { - // Install handlers - $error_handler = new Raven_ErrorHandler($client); - $error_handler->registerExceptionHandler(); - $error_handler->registerErrorHandler(); - $error_handler->registerShutdownFunction(); - } - - return $errors; - } - - /** - * Export the message - * - * @param array $content Array containing the info about the message - * @return void - */ - public function export($content) - { - if (! $this->isActive()) { - return; - } - - global $conf; - $dsn = $conf->global->SYSLOG_SENTRY_DSN; - $client = new Raven_Client( - $dsn, - array('curl_method' => 'exec') - ); - - $client->user_context(array( - 'username' => ($content['user'] ? $content['user'] : ''), - 'ip_address' => $content['ip'] - )); - - $client->tags_context(array( - 'version' => DOL_VERSION - )); - - $client->registerSeverityMap(array( - LOG_EMERG => Raven_Client::FATAL, - LOG_ALERT => Raven_Client::FATAL, - LOG_CRIT => Raven_Client::ERROR, - LOG_ERR => Raven_Client::ERROR, - LOG_WARNING => Raven_Client::WARNING, - LOG_NOTICE => Raven_Client::WARNING, - LOG_INFO => Raven_Client::INFO, - LOG_DEBUG => Raven_Client::DEBUG, - )); - - if (substr($content['message'], 0, 3) === 'sql') { - global $db; - $query = substr($content['message'], 4, strlen($content['message'])); - $client->captureQuery( - $query, - $client->translateSeverity($content['level']), - $db->type - ); - } else { - $client->captureMessage( - $content['message'], - null, - $client->translateSeverity($content['level']) - ); - } - } -} diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index ae1b29a5c48..e3cca7a73c7 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -67,51 +67,58 @@ $hookmanager->initHooks(array('searchform')); // Define $searchform $searchform = ''; -// TODO Mutualize code here with function left_menu into main.inc.php page -if ($conf->use_javascript_ajax && 1 == 2) +if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile { if (! is_object($form)) $form=new Form($db); $selected=-1; - $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'data-role="none"', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 0); + $searchform.='

    '.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'data-role="none"', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0); } else { + $conf->global->MAIN_HTML5_PLACEHOLDER = 1; + // Define $searchform if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_picto('','object_company','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', 'notitle'); } if (! empty($conf->societe->enabled) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_picto('','object_contact','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', 'notitle'); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) ) { $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_picto('','object_product','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', 'notitle'); } if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_picto('','object_projectpub','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', 'notitle'); } if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) { $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_picto('','object_user','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', 'notitle'); } if (! empty($conf->user->enabled) && $user->rights->user->user->lire) { $langs->load("users"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_picto('','object_user','', 0, 1)); + //$searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', 'notitle'); } } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b60ad5c963a..8f6cb409b2c 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1075,19 +1075,21 @@ class Cronjob extends CommonObject } if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK)); } - } - dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG); - - // Update with result - if (is_array($output_arr) && count($output_arr)>0) - { - foreach($output_arr as $val) - { - $this->lastoutput.=$val."\n"; - } + // Update with result + if (is_array($output_arr) && count($output_arr)>0) + { + foreach($output_arr as $val) + { + $this->lastoutput.=$val."\n"; + } + } + + $this->lastresult=$retval; + + dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true)." lastoutput=".$this->lastoutput." lastresult=".$this->lastresult, LOG_DEBUG); } - $this->lastresult=$retval; + $this->datelastresult=dol_now(); $result = $this->update($user); // This include begin/commit if ($result < 0) diff --git a/htdocs/don/index.php b/htdocs/don/index.php index 73c9e56d29c..9894de3a2b5 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -79,11 +79,32 @@ if ($result) print load_fiche_titre($langs->trans("DonationsArea")); -print '
    IdOwnerPrinterFileStatusCancel'.$langs->trans("Id").''.$langs->trans("Date").''.$langs->trans("Owner").''.$langs->trans("Printer").''.$langs->trans("Filename").''.$langs->trans("Status").''.$langs->trans("Cancel").'
    '.$value['id'].''.$dates.''.$value['ownerId'].''.$value['printerName'].''.$value['title'].'
    '; +print '
    '; -// Left area -print '
    '; +if (! empty($conf->don->enabled) && $user->rights->don->lire) +{ + $listofsearchfields['search_donation']=array('text'=>'Donation'); +} +if (count($listofsearchfields)) +{ + print '
    '; + print ''; + print ''; + $i=0; + foreach($listofsearchfields as $key => $value) + { + if ($i == 0) print ''; + print ''; + print ''; + if ($i == 0) print ''; + print ''; + $i++; + } + print '
    '.$langs->trans("Search").'
    '; + print '
    '; + print '
    '; +} print ''; print ''; @@ -136,8 +157,7 @@ print ''; print "
    "; -// Right area -print '
    '; +print '
    '; $max=10; @@ -203,7 +223,7 @@ if ($resql) else dol_print_error($db); -print '
    '; +print ''; llxFooter(); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 23943fd5282..2d43faf016a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1079,8 +1079,9 @@ else if ($action == 'remove_file') /* * View */ - -llxHeader('', $langs->trans("ExpenseReport")); +$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Card"); +$helpurl="EN:Module_Expense_Reports"; +llxHeader("",$title,$helpurl); $form = new Form($db); $formfile = new FormFile($db); @@ -1137,7 +1138,7 @@ if ($action == 'create') // Public note print ''; print '' . $langs->trans('NotePublic') . ''; - print ''; + print ''; $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -1147,7 +1148,7 @@ if ($action == 'create') if (empty($user->societe_id)) { print ''; print '' . $langs->trans('NotePrivate') . ''; - print ''; + print ''; $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -1159,7 +1160,7 @@ if ($action == 'create') dol_fiche_end(); - print '
    '; + print '
    '; print ''; print '     '; print '
    '; @@ -1200,7 +1201,7 @@ else print ''; print ''; - dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); + dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); if($object->fk_statut==99) { @@ -1216,7 +1217,7 @@ else $linkback = ''.$langs->trans("BackToList").''; // Ref - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print ''; @@ -1261,7 +1262,7 @@ else print ''; $userfee=new User($db); $userfee->fetch($object->fk_user_valid); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); print ''; } @@ -1270,7 +1271,7 @@ else print ''; $userfee=new User($db); $userfee->fetch($object->fk_user_author); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); print ''; if ($object->fk_statut==6) { @@ -1279,7 +1280,7 @@ else print ''; $userfee=new User($db); $userfee->fetch($user->id); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); print ''; } @@ -1287,7 +1288,7 @@ else // Public note print ''; print '' . $langs->trans('NotePublic') . ''; - print ''; + print ''; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -1297,7 +1298,7 @@ else if (empty($user->societe_id)) { print ''; print '' . $langs->trans('NotePrivate') . ''; - print ''; + print ''; $doleditor = new DolEditor('note_private', $object->note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); print $doleditor->Create(1); @@ -1317,7 +1318,7 @@ else } else { - dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); + dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); if ($action == 'save') { @@ -1435,7 +1436,6 @@ else $sql.= " AND p.fk_typepayment = c.id"; $sql.= " ORDER BY dp"; - //print $sql; $resql = $db->query($sql); if ($resql) { @@ -1504,7 +1504,7 @@ else $userauthor=new User($db); $result=$userauthor->fetch($object->fk_user_author); if ($result < 0) dol_print_error('',$userauthor->error); - print $userauthor->getNomUrl(1); + print $userauthor->getNomUrl(-1); } print ''; @@ -1527,7 +1527,7 @@ else { $userfee=new User($db); $userfee->fetch($object->fk_user_validator); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); if (empty($userfee->email) || ! isValidEmail($userfee->email)) { $langs->load("errors"); @@ -1545,7 +1545,7 @@ else { $userfee=new User($db); $userfee->fetch($object->fk_user_cancel); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); } print ''; print ''; @@ -1566,7 +1566,7 @@ else { $userapp=new User($db); $userapp->fetch($object->fk_user_approve); - print $userapp->getNomUrl(1); + print $userapp->getNomUrl(-1); } print ''; print ''; @@ -1582,7 +1582,7 @@ else print ''; $userfee=new User($db); $userfee->fetch($object->fk_user_refuse); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); print ''; print ''; print ''.$langs->trans("DATE_REFUS").''; @@ -1600,7 +1600,7 @@ else print ''; $userfee=new User($db); $userfee->fetch($object->fk_user_paid); - print $userfee->getNomUrl(1); + print $userfee->getNomUrl(-1); print ''; print ''; print ''.$langs->trans("DATE_PAIEMENT").''; @@ -1702,17 +1702,19 @@ else } // Ajout des boutons de modification/suppression - print ''; if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer) { + print ''; + print 'rowid.'#'.$objp->rowid.'">'; print img_edit(); print '   '; print 'rowid.'">'; print img_delete(); print ''; + + print ''; } - print ''; print ''; } @@ -1904,12 +1906,12 @@ if ($action != 'create' && $action != 'edit') if ($object->fk_user_author == $user->id) { // Modify - print 'id.'">'.$langs->trans('Modify').''; + print ''; // Validate if (count($object->lines) > 0 || count($object->lignes) > 0) { - print 'id.'">'.$langs->trans('ValidateAndSubmit').''; + print ''; } } } @@ -1924,12 +1926,12 @@ if ($action != 'create' && $action != 'edit') if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Modify - print 'id.'">'.$langs->trans('Modify').''; + print ''; // Brouillonner (le statut refusée est identique à brouillon) //print ''.$langs->trans('BROUILLONNER').''; // Enregistrer depuis le statut "Refusée" - print 'id.'">'.$langs->trans('ValidateAndSubmit').''; + print ''; } } @@ -1938,7 +1940,7 @@ if ($action != 'create' && $action != 'edit') if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Brouillonner - print 'id.'">'.$langs->trans('SetToDraft').''; + print ''; } } @@ -1952,7 +1954,7 @@ if ($action != 'create' && $action != 'edit') if ($object->fk_user_author == $user->id) { // Brouillonner - print 'id.'">'.$langs->trans('SetToDraft').''; + print ''; } } @@ -1961,15 +1963,15 @@ if ($action != 'create' && $action != 'edit') //if($object->fk_user_validator==$user->id) //{ // Validate - print 'id.'">'.$langs->trans('Approve').''; + print ''; // Deny - print 'id.'">'.$langs->trans('Deny').''; + print ''; //} if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Cancel - print 'id.'">'.$langs->trans('Cancel').''; + print ''; } } @@ -1979,7 +1981,7 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->approve && $object->fk_statut == 5) { - print 'id.'">'.$langs->trans('Deny').''; + print ''; } // If bank module is used @@ -2008,14 +2010,14 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->creer && ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) && $object->fk_statut == 5) { // Cancel - print 'id.'">'.$langs->trans('Cancel').''; + print ''; } // TODO Replace this. It should be SetUnpaid and should go back to status unpaid not canceled. if (($user->rights->expensereport->approve || $user->rights->expensereport->to_paid) && $object->fk_statut == 6) { // Cancel - print 'id.'">'.$langs->trans('Cancel').''; + print ''; } @@ -2023,12 +2025,12 @@ if ($action != 'create' && $action != 'edit') if ($user->rights->expensereport->creer && $user->id == $object->fk_user_author && $object->fk_statut <= 4) { // Delete - print 'id.'">'.$langs->trans('Delete').''; + print ''; } else if($user->rights->expensereport->supprimer && $object->fk_statut != 6) { // Delete - print 'id.'">'.$langs->trans('Delete').''; + print ''; } } diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index dd9a28a130c..00e8cfe583d 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -81,8 +81,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; $form = new Form($db); -llxHeader("",$langs->trans("ExpenseReport")); - +$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Documents"); +$helpurl="EN:Module_Expense_Reports"; +llxHeader("",$title,$helpurl); if ($object->id) { @@ -90,7 +91,7 @@ if ($object->id) $head=expensereport_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip'); + dol_fiche_head($head, 'documents', $langs->trans("ExpenseReport"), 0, 'trip'); // Construit liste des fichiers diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 117ecc5e3c4..8d19a8e9f6d 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -142,7 +142,7 @@ $max=10; $langs->load("boxes"); -$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as fk_status"; +$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut, u.photo, d.rowid, d.ref, d.date_debut as dated, d.date_fin as datef, d.date_create as dm, d.total_ht, d.total_ttc, d.fk_statut as fk_status"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d, ".MAIN_DB_PREFIX."user as u"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE u.rowid = d.fk_user_author"; @@ -183,9 +183,12 @@ if ($result) $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; + $userstatic->login=$obj->login; + $userstatic->statut=$obj->statut; + $userstatic->photo=$obj->photo; print ''; print ''.$expensereportstatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(1).''; + print ''.$userstatic->getNomUrl(-1).''; print ''.price($obj->total_ht).''; print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php index a5a3c830975..b3ebbc153ef 100644 --- a/htdocs/expensereport/info.php +++ b/htdocs/expensereport/info.php @@ -39,8 +39,9 @@ $result = restrictedArea($user, 'expensereport', $id, ''); /* * View */ - -llxHeader('', $langs->trans("ExpenseReport")); +$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Info"); +$helpurl="EN:Module_Expense_Reports"; +llxHeader("",$title,$helpurl); if ($id) { @@ -50,7 +51,7 @@ if ($id) $head = expensereport_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip'); + dol_fiche_head($head, 'info', $langs->trans("ExpenseReport"), 0, 'trip'); print '"; @@ -335,12 +336,20 @@ if ($resql) if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) print img_warning($langs->trans("Late")); if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) print img_warning($langs->trans("Late")); print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; @@ -349,9 +358,9 @@ if ($resql) print "\n"; - $total_total_ht = $total_total_ht + $objp->total_ht; - $total_total_tva = $total_total_tva + $objp->total_tva; - $total_total_ttc = $total_total_ttc + $objp->total_ttc; + $total_total_ht = $total_total_ht + $obj->total_ht; + $total_total_tva = $total_total_tva + $obj->total_tva; + $total_total_ttc = $total_total_ttc + $obj->total_ttc; $i++; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index eac3c735d66..a2e43570545 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -140,7 +140,7 @@ if (empty($reshook)) } } } - + if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $result = $object->setValid($user); @@ -747,14 +747,14 @@ if (empty($reshook)) /* * Send mail */ - + // Actions to send emails $actiontypecode='AC_OTH_AUTO'; $trigger_name='FICHINTER_SENTBYMAIL'; $paramname='id'; $mode='emailfromintervention'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - + if ($action == 'update_extras') { @@ -969,7 +969,7 @@ if ($action == 'create') else $numprojet=select_projects($societe->id,$_POST["projectid"],'projectid'); */ - $numprojet=$formproject->select_projects($soc->id,GETPOST('projectid','int'),'projectid'); + $numprojet=$formproject->select_projects($soc->id,$projectid,'projectid'); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; @@ -1041,6 +1041,8 @@ if ($action == 'create') { print ''; print ''; + } elseif ($origin == 'project' && !empty($projectid)) { + print ''; } dol_fiche_end(); @@ -1058,6 +1060,13 @@ if ($action == 'create') dol_fiche_head(''); print ''; + if (is_object($objectsrc)) + { + print ''; + print ''; + } elseif ($origin == 'project' && !empty($projectid)) { + print ''; + } print '
    '; dol_print_object_info($object); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e09a74e20f3..d3a5205eeda 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -20,7 +20,7 @@ */ /** - * \file htdocs/expensereport/index.php + * \file htdocs/expensereport/list.php * \ingroup expensereport * \brief list of expense reports */ @@ -130,7 +130,7 @@ $pagenext = $page + 1; $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,"; $sql.= " d.date_debut, d.date_fin, d.date_valid,"; -$sql.= " u.rowid as id_user, u.firstname, u.lastname"; +$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.statut, u.photo"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid"; $sql.= " WHERE d.entity = ".$conf->entity; @@ -314,19 +314,20 @@ if ($resql) $total_total_tva = 0; $expensereportstatic=new ExpenseReport($db); - + $usertmp = new User($db); + if ($num > 0) { while ($i < min($num,$limit)) { - $objp = $db->fetch_object($resql); - - $expensereportstatic->id=$objp->rowid; - $expensereportstatic->ref=$objp->ref; - $expensereportstatic->status=$objp->status; - $expensereportstatic->valid=$objp->date_valid; - $expensereportstatic->date_debut=$objp->date_debut; - $expensereportstatic->date_fin=$objp->date_fin; + $obj = $db->fetch_object($resql); + + $expensereportstatic->id=$obj->rowid; + $expensereportstatic->ref=$obj->ref; + $expensereportstatic->status=$obj->status; + $expensereportstatic->valid=$obj->date_valid; + $expensereportstatic->date_debut=$obj->date_debut; + $expensereportstatic->date_fin=$obj->date_fin; $var=!$var; print "
    '.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').''.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').''.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).''.price($objp->total_ht).''.price($objp->total_tva).''.price($objp->total_ttc).''.($obj->date_debut > 0 ? dol_print_date($obj->date_debut, 'day') : '').''.($obj->date_fin > 0 ? dol_print_date($obj->date_fin, 'day') : '').''; + $usertmp->id=$obj->id_user; + $usertmp->lastname=$obj->lastname; + $usertmp->firstname=$obj->firstname; + $usertmp->login=$obj->login; + $usertmp->statut=$obj->statut; + $usertmp->photo=$obj->photo; + print $usertmp->getNomUrl(-1); + print ''.price($obj->total_ht).''.price($obj->total_tva).''.price($obj->total_ttc).''; print $expensereportstatic->getLibStatut(5); print '
    '; print ''; print ''; } - + if (! empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) { // Date Start @@ -1191,14 +1200,14 @@ else if ($id > 0 || ! empty($ref)) print $object->dateo ? dol_print_date($object->dateo, 'daytext') : ' '; print ''; print ''; - + // Date End print ''; print ''; print ''; - + // Date Terminate/close print ''; print ''; - + // Duration print ''; } @@ -372,16 +374,45 @@ if ($result) { $obj = $db->fetch_object($result); - $interventionstatic->id=$obj->fichid; - $interventionstatic->ref=$obj->ref; - $interventionstatic->statut=$obj->fk_statut; + $objectstatic->id=$obj->rowid; + $objectstatic->ref=$obj->ref; + $objectstatic->statut=$obj->fk_statut; $var=!$var; print ""; if (! empty($arrayfields['f.ref']['checked'])) { print "\n"; if (! $i) $totalarray['nbfield']++; } @@ -460,7 +491,7 @@ if ($result) // Status if (! empty($arrayfields['f.fk_statut']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Action column diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index d8bb890c0dd..f03e511f8d0 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -120,8 +120,8 @@ if ($id > 0 && empty($object->id)) if ($object->id > 0) { - $title=$langs->trans("ThirdParty")." - ".$langs->trans('SupplierCard'); - if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('SupplierCard'); + $title=$langs->trans("ThirdParty")." - ".$langs->trans('Supplier'); + if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('Supplier'); $help_url=''; llxHeader('',$title, $help_url); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f7bab6cd2f4..07e86418516 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1460,7 +1460,6 @@ class CommandeFournisseur extends CommonOrder $this->line->date_start=$date_start; $this->line->date_end=$date_end; - // Multicurrency $this->line->fk_multicurrency = $this->fk_multicurrency; $this->line->multicurrency_code = $this->multicurrency_code; @@ -1989,28 +1988,58 @@ class CommandeFournisseur extends CommonOrder * * @param User $user Objet user making change * @param timestamp $date_livraison Planned delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers * @return int <0 if KO, >0 if OK */ - function set_date_livraison($user, $date_livraison) + function set_date_livraison($user, $date_livraison, $notrigger=0) { if ($user->rights->fournisseur->commande->creer) { - $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; + $error=0; + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); - $resql=$this->db->query($sql); - if ($resql) - { - $this->date_livraison = $date_livraison; - return 1; - } - else - { - $this->error=$this->db->error(); - return -1; - } + dol_syslog(__METHOD__, LOG_DEBUG); + $resql=$this->db->query($sql); + if (!$resql) + { + $this->errors[]=$this->db->error(); + $error++; + } + + if (! $error) + { + $this->oldcopy= clone $this; + $this->date_livraison = $date_livraison; + } + + if (! $notrigger && empty($error)) + { + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + foreach($this->errors as $errmsg) + { + dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } } else { @@ -2023,27 +2052,57 @@ class CommandeFournisseur extends CommonOrder * * @param User $user Objet utilisateur qui modifie * @param int $id_projet Date de livraison + * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers * @return int <0 si ko, >0 si ok */ - function set_id_projet($user, $id_projet) + function set_id_projet($user, $id_projet, $notrigger=0) { if ($user->rights->fournisseur->commande->creer) { + $error=0; + + $this->db->begin(); + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET fk_projet = ".($id_projet > 0 ? (int) $id_projet : 'null'); $sql.= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_id_projet", LOG_DEBUG); + dol_syslog(__METHOD__, LOG_DEBUG); $resql=$this->db->query($sql); - if ($resql) + if (!$resql) { - $this->fk_projet = $id_projet; - return 1; + $this->errors[]=$this->db->error(); + $error++; + } + + if (! $error) + { + $this->oldcopy= clone $this; + $this->fk_projet = $id_projet; + } + + if (! $notrigger && empty($error)) + { + // Call trigger + $result=$this->call_trigger('ORDER_SUPPLIER_MODIFY',$user); + if ($result < 0) $error++; + // End call triggers + } + + if (! $error) + { + $this->db->commit(); + return 1; } else { - $this->error=$this->db->error(); - return -1; + foreach($this->errors as $errmsg) + { + dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } } else @@ -2974,7 +3033,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql.= "'".price2num($this->total_localtax2)."',"; $sql.= "'".price2num($this->total_ttc)."',"; $sql.= ($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'":"null"); - $sql.= ", ".$this->fk_multicurrency; + $sql.= ", ".($this->fk_multicurrency ? $this->fk_multicurrency : "null"); $sql.= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql.= ", ".price2num($this->pu_ht * $this->multicurrency_tx); $sql.= ", ".$this->multicurrency_total_ht; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index aab90ce4b49..8a814c492d0 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -856,10 +856,12 @@ class FactureFournisseur extends CommonInvoice /** * Tag invoice as a payed invoice * - * @param User $user Object user - * @return int <0 si ko, >0 si ok + * @param User $user Object user + * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet. Not implementd yet. + * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet. Not implementd yet. + * @return int <0 si ko, >0 si ok */ - function set_paid($user) + function set_paid($user, $close_code='', $close_note='') { global $conf,$langs; $error=0; diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 78bdab0f6c5..738c0eb716f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -130,7 +130,7 @@ class PaiementFourn extends Paiement * @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more * @return int id of created payment, < 0 if error */ - function create($user,$closepaidinvoices=0) + function create($user, $closepaidinvoices=0) { global $langs,$conf; @@ -141,6 +141,8 @@ class PaiementFourn extends Paiement $totalamount = 0; $totalamount_converted = 0; + dol_syslog(get_class($this)."::create", LOG_DEBUG); + if ($way == 'dolibarr') { $amounts = &$this->amounts; @@ -188,7 +190,6 @@ class PaiementFourn extends Paiement $sql.= " VALUES ('".$this->db->escape($ref)."', ".$conf->entity.", '".$this->db->idate($now)."',"; $sql.= " '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.", 0)"; - dol_syslog("PaiementFourn::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -220,7 +221,7 @@ class PaiementFourn extends Paiement $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); if ($remaintopay == 0) { - $result=$invoice->set_paid($user,'',''); + $result=$invoice->set_paid($user, '', ''); } else dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing."); } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b323f58e0b8..c8dd329bb61 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -165,7 +165,7 @@ if (empty($reshook)) $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - + // Multicurrency Code else if ($action == 'setmulticurrencycode' && $user->rights->fournisseur->commande->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); @@ -173,7 +173,7 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } // bank account @@ -218,13 +218,13 @@ if (empty($reshook)) //$newstatus=3; // Submited // TODO If there is at least one reception, we can set to Received->Received partially $newstatus=4; // Received partially - + } else if ($object->statut == 6) $newstatus=2; // Canceled->Approved else if ($object->statut == 7) $newstatus=3; // Canceled->Process running else if ($object->statut == 9) $newstatus=1; // Refused->Validated else $newstatus = 2; - + //print "old status = ".$object->statut.' new status = '.$newstatus; $db->begin(); @@ -237,7 +237,7 @@ if (empty($reshook)) $sql.= ' WHERE rowid = '.$object->id; $resql=$db->query($sql); - + if ($newstatus == 0) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur'; @@ -351,7 +351,7 @@ if (empty($reshook)) $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) } - + if (GETPOST('idprodfournprice') > 0) { $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. @@ -367,7 +367,7 @@ if (empty($reshook)) if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $type = $productsupplier->type; - + $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice')); if (empty($tva_tx)) $tva_npr=0; @@ -763,7 +763,7 @@ if (empty($reshook)) $result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']); if ($result > 0) { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; @@ -870,10 +870,10 @@ if (empty($reshook)) if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) // En get ou en post { // Build document - + // Save last template used to generate document if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha')); - + $outputlangs = $langs; if (GETPOST('lang_id')) { @@ -899,7 +899,7 @@ if (empty($reshook)) if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } - + if ($action == 'update_extras') { // Fill array 'array_options' with data from add form @@ -972,7 +972,7 @@ if (empty($reshook)) $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); $object->multicurrency_tx = GETPOST('originmulticurrency_tx', 'int'); $object->fk_project = GETPOST('projectid'); - + // Fill array 'array_options' with data from add form if (! $error) { @@ -994,7 +994,7 @@ if (empty($reshook)) $element = 'supplier_proposal'; $subelement = 'supplier_proposal'; } - + $object->origin = $origin; $object->origin_id = $originid; @@ -1031,7 +1031,7 @@ if (empty($reshook)) $num = count($lines); $productsupplier = new ProductFournisseur($db); - + for($i = 0; $i < $num; $i ++) { @@ -1041,12 +1041,12 @@ if (empty($reshook)) $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); - + // Reset fk_parent_line for no child products and special product if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { $fk_parent_line = 0; } - + // Extrafields if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if // trigger used @@ -1056,17 +1056,17 @@ if (empty($reshook)) } $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty); - if ($result>=0) + if ($result>=0) { $tva_tx = $lines[$i]->tva_tx; - + if ($origin=="commande") { $soc=new societe($db); $soc->fetch($socid); $tva_tx=get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $productsupplier->product_fourn_price_id); } - + $result = $object->addline( $desc, $lines[$i]->subprice, @@ -1089,7 +1089,7 @@ if (empty($reshook)) $lines[$i]->fk_unit ); } - + if ($result < 0) { $error++; break; @@ -1102,8 +1102,8 @@ if (empty($reshook)) } // Add link between elements - - + + // Hooks $parameters = array('objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been @@ -1149,14 +1149,14 @@ if (empty($reshook)) /* * Send mail */ - + // Actions to send emails $actiontypecode='AC_SUP_ORD'; $trigger_name='ORDER_SUPPLIER_SENTBYMAIL'; $paramname='id'; $mode='emailfromsupplierorder'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - + if ($action == 'webservice' && GETPOST('mode', 'alpha') == "send" && ! GETPOST('cancel')) { @@ -1380,9 +1380,9 @@ if ($action=='create') if (!empty($conf->multicurrency->enabled)) { if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; - if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; + if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } - + $note_private = $object->getDefaultCreateValueFor('note_private', (! empty($objectsrc->note_private) ? $objectsrc->note_private : null)); $note_public = $object->getDefaultCreateValueFor('note_public', (! empty($objectsrc->note_public) ? $objectsrc->note_public : null)); @@ -1394,9 +1394,9 @@ if ($action=='create') { $cond_reglement_id = $societe->cond_reglement_supplier_id; $mode_reglement_id = $societe->mode_reglement_supplier_id; - + if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; - + $note_private = $object->getDefaultCreateValueFor('note_private'); $note_public = $object->getDefaultCreateValueFor('note_public'); } @@ -1409,7 +1409,7 @@ if ($action=='create') print ''; print ''; if (!empty($currency_tx)) print ''; - + dol_fiche_head(''); print '
    '.$langs->trans("ThirdParty").''; print $form->select_company('','socid','','SelectThirdParty',1); @@ -1151,7 +1160,7 @@ else if ($id > 0 || ! empty($ref)) // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneIntervention'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - + if (!$formconfirm) { $parameters=array('lineid'=>$lineid); @@ -1182,7 +1191,7 @@ else if ($id > 0 || ! empty($ref)) print ''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
    '.$langs->trans("Datee").''; print $object->datee ? dol_print_date($object->datee, 'daytext') : ' '; print '
    '.$langs->trans("Datet").''; @@ -1442,7 +1451,7 @@ else if ($id > 0 || ! empty($ref)) print ''; $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention"); print ''; if (empty($conf->global->FICHINTER_WITHOUT_DURATION)) { @@ -1643,7 +1652,7 @@ else if ($id > 0 || ! empty($ref)) if ($user->rights->ficheinter->creer) { print ''; } - + // Delete if (($object->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) { @@ -1754,7 +1763,7 @@ else if ($id > 0 || ! empty($ref)) { include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'int'.$object->id); - } + } $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 5d88dd78977..d6de8f3c19b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -27,6 +27,7 @@ */ require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -134,13 +135,14 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP */ $form = new Form($db); -$interventionstatic=new Fichinter($db); +$formfile = new FormFile($db); +$objectstatic=new Fichinter($db); llxHeader('', $langs->trans("Intervention")); $sql = "SELECT"; -$sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description, f.datec as date_creation, f.tms as date_update,"; +$sql.= " f.ref, f.rowid, f.fk_statut, f.description, f.datec as date_creation, f.tms as date_update, f.note_private,"; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; $sql.= " s.nom as name, s.rowid as socid, s.client"; // Add fields from extrafields @@ -352,7 +354,7 @@ if ($result) if (! empty($arrayfields['f.fk_statut']['checked'])) { print ''; - $liststatus=$interventionstatic->statuts_short; + $liststatus=$objectstatic->statuts_short; print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); print '
    "; - print $interventionstatic->getNomUrl(1); + + print ''; + // Picto + Ref + print ''; + // Warning + $warnornote=''; + //if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->fichinter->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); + if (! empty($obj->note_private)) + { + $warnornote.=($warnornote?' ':''); + $warnornote.= ''; + $warnornote.= ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + $warnornote.= ''; + } + if ($warnornote) + { + print ''; + } + // Other picto tool + print '
    '; + print $objectstatic->getNomUrl(1); + print ''; + print $warnornote; + print ''; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->fichinter->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + print '
    '; + print "
    '.$interventionstatic->LibStatut($obj->fk_statut,5).''.$objectstatic->LibStatut($obj->fk_statut,5).'
    '; @@ -1497,7 +1497,7 @@ if ($action=='create') print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print ''; } - + print ''; print '"; - + if (!empty($conf->multicurrency->enabled)) { print ''; print ''; - print ''; + print ''; } } @@ -1571,7 +1571,7 @@ if ($action=='create') print "\n"; // Show origin lines - if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) + if (! empty($origin) && ! empty($originid) && is_object($objectsrc)) { $title = $langs->trans('ProductsAndServices'); print load_fiche_titre($title); @@ -1631,7 +1631,7 @@ elseif (! empty($object->id)) $object->date_commande=dol_now(); // We check if number is temporary number - if (preg_match('/^[\(]?PROV/i',$object->ref) || empty($object->ref)) // empty should not happened, but when it occurs, the test save life + if (preg_match('/^[\(]?PROV/i',$object->ref) || empty($object->ref)) // empty should not happened, but when it occurs, the test save life { $newref = $object->getNextNumRef($object->thirdparty); } @@ -1841,7 +1841,7 @@ elseif (! empty($object->id)) $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); } print ''; - + // Multicurrency if (! empty($conf->multicurrency->enabled)) { @@ -1861,7 +1861,7 @@ elseif (! empty($object->id)) $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print ''; - + // Multicurrency rate print ''; print ''; print ''; print ''; - + // Multicurrency Amount VAT print ''; print ''; print ''; - + // Multicurrency Amount TTC print ''; print ''; - print ''; + print ''; } print "
    '.$langs->trans('NotePublic').''; $doleditor = new DolEditor('note_public', isset($note_public) ? $note_public : GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); @@ -1539,12 +1539,12 @@ if ($action=='create') } print '
    ' . $langs->trans('TotalTTC') . '' . price($objectsrc->total_ttc) . "
    ' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . '
    ' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . '
    ' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . '
    ' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . '
    '; @@ -2021,16 +2021,16 @@ elseif (! empty($object->id)) print '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '

    "; @@ -2339,7 +2339,7 @@ elseif (! empty($object->id)) { include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'sor'.$object->id); - } + } $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; @@ -2615,7 +2615,7 @@ elseif (! empty($object->id)) /** * Boutons actions */ - + if ($user->societe_id == 0 && $action != 'editline' && $action != 'delete') { print '
    '; @@ -2625,7 +2625,7 @@ elseif (! empty($object->id)) // modified by hook if (empty($reshook)) { - + // Validate if ($object->statut == 0 && $num > 0) { @@ -2771,7 +2771,7 @@ elseif (! empty($object->id)) { print ''.$langs->trans("CreateBill").''; } - + if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && !empty($object->linkedObjectsIds['invoice_supplier'])) { print ''.$langs->trans("ClassifyBilled").''; @@ -2808,7 +2808,7 @@ elseif (! empty($object->id)) } } - + print "
    "; } @@ -2831,12 +2831,10 @@ elseif (! empty($object->id)) print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang); $somethingshown=$formfile->numoffiles; - // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('order_supplier')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - print '
    '; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0eada7d918f..7f7cbdf44eb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -118,7 +118,7 @@ if (empty($reshook)) $object->fetch_thirdparty(); $result = $object->add_object_linked('order_supplier', GETPOST('linkedOrder')); } - + // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') { @@ -248,7 +248,7 @@ if (empty($reshook)) if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer) { $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); - + if ($object->update($user) < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -265,7 +265,7 @@ if (empty($reshook)) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); } - + // Multicurrency Code else if ($action == 'setmulticurrencycode' && $user->rights->facture->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); @@ -273,7 +273,7 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->facture->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } // bank account @@ -486,7 +486,7 @@ if (empty($reshook)) break; } } - + // Now reload line $object->fetch_lines(); } @@ -507,7 +507,7 @@ if (empty($reshook)) { $error++; } - + if (! $error) { // If some invoice's lines already known @@ -545,7 +545,7 @@ if (empty($reshook)) { $langs->load("errors"); $db->rollback(); - + setEventMessages($object->error, $object->errors, 'errors'); $action='create'; $_GET['socid']=$_POST['socid']; @@ -939,14 +939,14 @@ if (empty($reshook)) /* * Send mail */ - + // Actions to send emails $actiontypecode='AC_SUP_INV'; $trigger_name='BILL_SUPPLIER_SENTBYMAIL'; $paramname='id'; $mode='emailfromsupplierinvoice'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - + // Build document if ($action == 'builddoc') @@ -1113,7 +1113,9 @@ $formfile = new FormFile($db); $bankaccountstatic=new Account($db); $paymentstatic=new PaiementFourn($db); -llxHeader('',$langs->trans('SupplierInvoice'),''); +$title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Card'); +$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; +llxHeader('', $title, $helpurl); // Mode creation if ($action == 'create') @@ -1126,7 +1128,7 @@ if ($action == 'create') dol_htmloutput_events(); $currency_code = $conf->currency; - + $societe=''; if (GETPOST('socid') > 0) { @@ -1134,7 +1136,7 @@ if ($action == 'create') $societe->fetch(GETPOST('socid','int')); if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) $currency_code = $societe->multicurrency_code; } - + if (GETPOST('origin') && GETPOST('originid')) { // Parse element/subelement (ex: project_task) @@ -1182,9 +1184,9 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled)) { if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code; - if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; + if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx; } - + $datetmp=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); @@ -1200,7 +1202,7 @@ if ($action == 'create') $dateinvoice=($datetmp==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datetmp); $datetmp=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); $datedue=($datetmp==''?-1:$datetmp); - + if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; } @@ -1211,9 +1213,9 @@ if ($action == 'create') print ''; print ''; if (!empty($currency_tx)) print ''; - + dol_fiche_head(); - + print ''; // Ref @@ -1445,12 +1447,12 @@ if ($action == 'create') } } print '"; - + if (!empty($conf->multicurrency->enabled)) { print ''; print '"; - print '"; + print '"; } } else @@ -1722,7 +1724,7 @@ else if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } if (! empty($conf->incoterm->enabled)) $nbrows++; - + // Local taxes if ($societe->localtax1_assuj=="1") $nbrows++; if ($societe->localtax2_assuj=="1") $nbrows++; @@ -1827,7 +1829,7 @@ else $form_permission = $object->statutrights->fournisseur->facture->creer && $object->getSommePaiement() <= 0; // Date - print ''; @@ -1897,7 +1899,7 @@ else $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print ''; - + // Multicurrency rate print ''; print ''; print ''; print ''; - + // Multicurrency Amount VAT print ''; print ''; print ''; - + // Multicurrency Amount TTC print ''; print ''; - print ''; + print ''; } // Project @@ -2083,7 +2085,7 @@ else global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax; $forceall=1; $senderissupplier=1; $dateSelector=0; $inputalsopricewithtax=1; - + // Show object lines if (! empty($object->lines)) $ret = $object->printObjectLines($action, $societe, $mysoc, $lineid, 1); @@ -2124,15 +2126,15 @@ else $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook - if (empty($reshook)) + if (empty($reshook)) { - + // Modify a validated invoice with no payments if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer) { print ''.$langs->trans('Modify').''; } - + // Reopen a standard paid invoice if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) { @@ -2145,7 +2147,7 @@ else print ''.$langs->trans('ReOpen').''; } } - + // Send by mail if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) { @@ -2155,23 +2157,23 @@ else } else print ''.$langs->trans('SendByMail').''; } - - + + // Make payments if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice } - + // Classify paid if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { print ''.$langs->trans('ClassifyPaid').''; - + //print ''.$langs->trans('ClassifyPaid').''; } - + // Validate if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_DRAFT) { @@ -2190,19 +2192,19 @@ else } } } - + // Create event if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page. { print ''; } - + // Clone if ($action != 'edit' && $user->rights->fournisseur->facture->creer) { print 'socid.'">'.$langs->trans('ToClone').''; } - + // Delete if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer) { @@ -2214,17 +2216,14 @@ else } print ''; print '
    '; - + if ($action != 'edit') { print '
    '; - //print '
    '.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc)."
    ' . $langs->trans('MulticurrencyTotalHT') . '' . price($objectsrc->multicurrency_total_ht) . '
    ' . $langs->trans('MulticurrencyTotalVAT') . '' . price($objectsrc->multicurrency_total_tva) . "
    ' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . "
    ' . $langs->trans('MulticurrencyTotalTTC') . '' . price($objectsrc->multicurrency_total_ttc) . "
    '.$form->editfieldkey("Date",'datef',$object->datep,$object,$form_permission,'datepicker').''; + print '
    '.$form->editfieldkey("DateInvoice",'datef',$object->datep,$object,$form_permission,'datepicker').''; print $form->editfieldval("Date",'datef',$object->datep,$object,$form_permission,'datepicker'); print '
    '; @@ -1973,16 +1975,16 @@ else print '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '; - //print ''; // ancre - - /* + + /* * Documents generes - */ - + */ $ref=dol_sanitizeFileName($object->ref); $subdir = get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref; $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref; @@ -2232,25 +2231,23 @@ else $genallowed=$user->rights->fournisseur->facture->creer; $delallowed=$user->rights->fournisseur->facture->supprimer; $modelpdf=(! empty($object->modelpdf)?$object->modelpdf:(empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)?'':$conf->global->INVOICE_SUPPLIER_ADDON_PDF)); - + print $formfile->showdocuments('facture_fournisseur',$subdir,$filedir,$urlsource,$genallowed,$delallowed,$modelpdf,1,0,0,40,0,'','','',$societe->default_lang); $somethingshown=$formfile->numoffiles; - // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice_supplier')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - - - print '
    '; + + print '
    '; //print '
    '; //print '
    '; - + // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); $somethingshown=$formactions->showactions($object,'invoice_supplier',$socid,0,'listaction'.($genallowed?'largetitle':'')); - + print ''; //print '
    '; } @@ -2317,7 +2314,7 @@ else { include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'sin'.$object->id); - } + } $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index fbcb907ec74..1da6e0699fc 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -112,7 +112,9 @@ else if ($action == 'deletecontact' && $user->rights->fournisseur->facture->cree * View */ -llxHeader('',$langs->trans('SupplierInvoice')); +$title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('ContactsAddresses'); +$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; +llxHeader('', $title, $helpurl); $form = new Form($db); $formcompany = new FormCompany($db); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 97e84d0cb6e..3ca1c2d05fa 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -81,7 +81,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; $form = new Form($db); -llxHeader('',$langs->trans('SupplierInvoice')); +$title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Documents'); +$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; +llxHeader('', $title, $helpurl); if ($object->id > 0) { diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 4dad6ea7f86..590d5ea75bd 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -43,7 +43,9 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); * View */ -llxHeader('',$langs->trans('SupplierInvoice')); +$title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Info'); +$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; +llxHeader('', $title, $helpurl); $object = new FactureFournisseur($db); $object->fetch($id); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 1b8a4cd6bbc..eeb9d37f2fd 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -67,7 +67,9 @@ if ($action == 'setlabel' && $user->rights->fournisseur->facture->creer) $form = new Form($db); -llxHeader('',$langs->trans('SupplierInvoice')); +$title = $langs->trans('SupplierInvoice') . " - " . $langs->trans('Notes'); +$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; +llxHeader('', $title, $helpurl); if ($object->id > 0) { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 4c6aeb99110..1103804b72c 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2012-2015 Laurent Destailleur + * Copyright (C) 2012-2016 Laurent Destailleur * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Ferran Marcet @@ -1010,7 +1010,7 @@ else print ''.$langs->trans("User").''; print ''; - print $userRequest->getNomUrl(1, 'leave'); + print $userRequest->getNomUrl(-1, 'leave'); print ''; // Type @@ -1120,14 +1120,14 @@ else $userCreate->fetch($cp->fk_user_create); print ''; print ''.$langs->trans('RequestByCP').''; - print ''.$userCreate->getNomUrl(1).''; + print ''.$userCreate->getNomUrl(-1).''; print ''; } if (!$edit) { print ''; print ''.$langs->trans('ReviewedByCP').''; - print ''.$valideur->getNomUrl(1).''; + print ''.$valideur->getNomUrl(-1).''; print ''; } else { print ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index b76c90cbf48..75fe446d64d 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -298,11 +298,17 @@ class Holiday extends CommonObject $sql.= " cp.detail_refuse,"; $sql.= " uu.lastname as user_lastname,"; - $sql.= " uu.firstname as user_firstname,"; - + $sql.= " uu.firstname as user_firstname,"; + $sql.= " uu.login as user_login,"; + $sql.= " uu.statut as user_statut,"; + $sql.= " uu.photo as user_photo,"; + $sql.= " ua.lastname as validator_lastname,"; - $sql.= " ua.firstname as validator_firstname"; - + $sql.= " ua.firstname as validator_firstname,"; + $sql.= " ua.login as validator_login,"; + $sql.= " ua.statut as validator_statut,"; + $sql.= " ua.photo as validator_photo"; + $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; $sql.= " WHERE cp.entity IN (".getEntity('holiday', 1).")"; $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau @@ -360,10 +366,16 @@ class Holiday extends CommonObject $tab_result[$i]['user_firstname'] = $obj->user_firstname; $tab_result[$i]['user_lastname'] = $obj->user_lastname; - + $tab_result[$i]['user_login'] = $obj->user_login; + $tab_result[$i]['user_statut'] = $obj->user_statut; + $tab_result[$i]['user_photo'] = $obj->user_photo; + $tab_result[$i]['validator_firstname'] = $obj->validator_firstname; $tab_result[$i]['validator_lastname'] = $obj->validator_lastname; - + $tab_result[$i]['validator_login'] = $obj->validator_login; + $tab_result[$i]['validator_statut'] = $obj->validator_statut; + $tab_result[$i]['validator_photo'] = $obj->validator_photo; + $i++; } @@ -412,10 +424,16 @@ class Holiday extends CommonObject $sql.= " uu.lastname as user_lastname,"; $sql.= " uu.firstname as user_firstname,"; - + $sql.= " uu.login as user_login,"; + $sql.= " uu.statut as user_statut,"; + $sql.= " uu.photo as user_photo,"; + $sql.= " ua.lastname as validator_lastname,"; - $sql.= " ua.firstname as validator_firstname"; - + $sql.= " ua.firstname as validator_firstname,"; + $sql.= " ua.login as validator_login,"; + $sql.= " ua.statut as validator_statut,"; + $sql.= " ua.photo as validator_photo"; + $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; $sql.= " WHERE cp.entity IN (".getEntity('holiday', 1).")"; $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau @@ -473,10 +491,16 @@ class Holiday extends CommonObject $tab_result[$i]['user_firstname'] = $obj->user_firstname; $tab_result[$i]['user_lastname'] = $obj->user_lastname; - + $tab_result[$i]['user_login'] = $obj->user_login; + $tab_result[$i]['user_statut'] = $obj->user_statut; + $tab_result[$i]['user_photo'] = $obj->user_photo; + $tab_result[$i]['validator_firstname'] = $obj->validator_firstname; $tab_result[$i]['validator_lastname'] = $obj->validator_lastname; - + $tab_result[$i]['validator_login'] = $obj->validator_login; + $tab_result[$i]['validator_statut'] = $obj->validator_statut; + $tab_result[$i]['validator_photo'] = $obj->validator_photo; + $i++; } // Retourne 1 et ajoute le tableau à la variable diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index e2554cffffb..4f45704a269 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -121,14 +121,14 @@ if ($object->id) print ''.$langs->trans("User").''; print ''; - print $userRequest->getNomUrl(1); + print $userRequest->getNomUrl(-1); print ''; // Type print ''; print ''.$langs->trans("Type").''; print ''; - $typeleaves=$object->getTypes(1,1); + $typeleaves=$object->getTypes(1,-1); print $typeleaves[$object->fk_type]['label']; print ''; print ''; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 013ee177726..a02d508cf1d 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -404,12 +404,18 @@ if (! empty($holiday->holiday)) $userstatic->id=$infos_CP['fk_user']; $userstatic->lastname=$infos_CP['user_lastname']; $userstatic->firstname=$infos_CP['user_firstname']; - + $userstatic->login=$infos_CP['user_login']; + $userstatic->statut=$infos_CP['user_statut']; + $userstatic->photo=$infos_CP['user_photo']; + // Valideur $approbatorstatic->id=$infos_CP['fk_validator']; $approbatorstatic->lastname=$infos_CP['validator_lastname']; $approbatorstatic->firstname=$infos_CP['validator_firstname']; - + $approbatorstatic->login=$infos_CP['validator_login']; + $approbatorstatic->statut=$infos_CP['validator_statut']; + $approbatorstatic->photo=$infos_CP['validator_photo']; + $date = $infos_CP['date_create']; print ''; @@ -419,8 +425,8 @@ if (! empty($holiday->holiday)) print $holidaystatic->getNomUrl(1); print ''; print ''.dol_print_date($date,'day').''; - print ''.$userstatic->getNomUrl('1', 'leave').''; - print ''.$approbatorstatic->getNomUrl('1').''; + print ''.$userstatic->getNomUrl(-1, 'leave').''; + print ''.$approbatorstatic->getNomUrl(-1).''; print ''; $label=$alltypeleaves[$infos_CP['fk_type']]['label']; print $label?$label:$infos_CP['fk_type']; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 1b0e779488a..8ee69dc54ad 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -100,8 +100,8 @@ foreach($cp->logs as $logs_CP) print ''; print ''.$logs_CP['rowid'].''; print ''.$logs_CP['date_action'].''; - print ''.$user_action->getNomUrl(1).''; - print ''.$user_update->getNomUrl(1).''; + print ''.$user_action->getNomUrl(-1).''; + print ''.$user_update->getNomUrl(-1).''; print ''.$logs_CP['type_action'].''; print ''; $label=$alltypeleaves[$logs_CP['fk_type']]['label']; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 5f004f15e09..25c2fbf24c7 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -110,7 +110,8 @@ if ($result) $establishmentstatic->id=$obj->rowid; $establishmentstatic->name=$obj->name; - + $establishmentstatic->status=$obj->status; + $var=!$var; print ''; print ''.$establishmentstatic->getNomUrl(1).''; @@ -119,7 +120,7 @@ if ($result) print ''.$obj->town.''; print ''; - print $establishmenttmp->getLibStatus(5); + print $establishmentstatic->getLibStatus(5); print ''; print "\n"; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 88b765740ef..9ff2e2065cc 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -58,8 +58,8 @@ class Establishment extends CommonObject { $this->db = $db; - $this->statuts_short = array(0 => 'Opened', 1 => 'Closed'); - $this->statuts = array(0 => 'Opened', 1 => 'Closed'); + $this->statuts_short = array(0 => 'Closed', 1 => 'Opened'); + $this->statuts = array(0 => 'Closed', 1 => 'Opened'); return 1; } @@ -157,7 +157,7 @@ class Establishment extends CommonObject $sql .= ", address = '".$this->address."'"; $sql .= ", zip = '".$this->zip."'"; $sql .= ", town = '".$this->town."'"; - + $sql .= ", fk_country = ".($this->country_id > 0 ? $this->country_id : 'null'); $sql .= ", status = '".$this->status."'"; $sql .= ", fk_user_mod = " . $user->id; $sql .= " WHERE rowid = ".$this->id; @@ -273,23 +273,23 @@ class Establishment extends CommonObject } if ($mode == 2) { - if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]); - if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut8').' '.$langs->trans($this->statuts_short[$status]); + if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts_short[$status]); + if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]); } if ($mode == 3) { - if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4'); - if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut8'); + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5'); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4'); } if ($mode == 4) { - if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]); - if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut8').' '.$langs->trans($this->statuts[$status]); + if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts[$status]); + if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]); } if ($mode == 5) { - if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4'); - if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut8'); + if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5'); + if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4'); } } diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 11179d218f8..eafa302886f 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -40,14 +40,18 @@ $id = GETPOST('id','int'); // List of status static $tmpstatus2label=array( - '0'=>'OpenEtablishment', - '1'=>'CloseEtablishment' + '0'=>'CloseEtablishment', + '1'=>'OpenEtablishment' ); $status2label=array(''); foreach ($tmpstatus2label as $key => $val) $status2label[$key]=$langs->trans($val); $object = new Establishment($db); +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once + + /* * Actions */ @@ -128,12 +132,13 @@ else if ($action == 'update') $error ++; } - if (empty($error)) { + if (empty($error)) + { $object->name = GETPOST('name', 'alpha'); $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); - $object->country_id = $_POST["country_id"]; + $object->country_id = GETPOST('country_id', 'int'); $object->fk_user_mod = $user->id; $result = $object->update($user); @@ -373,7 +378,8 @@ else if ($id) print ''; // Status - print ''.$langs->trans("Status").''.$object->getLibStatus(4).''; + print ''.$langs->trans("Status").''; + print $object->getLibStatus(4).''; print ""; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 9f1ecaa6c5d..acc16eb0d3e 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -97,7 +97,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''.$langs->trans("Search").''; print ''; - print ':'; + print ''; if ($i == 0) print ''; print ''; $i++; @@ -145,7 +145,7 @@ $langs->load("boxes"); // Last leave requests if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) { - $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status"; + $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.photo, u.statut, x.rowid, x.rowid as ref, x.fk_type, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.tms as dm, x.statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE u.rowid = x.fk_user"; $sql.= " AND x.entity = ".$conf->entity; @@ -187,9 +187,12 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; + $userstatic->login=$obj->login; + $userstatic->photo=$obj->photo; + $userstatic->statut=$obj->statut; print ''; print ''.$holidaystatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(1, 'leave').''; + print ''.$userstatic->getNomUrl(-1, 'leave').''; print ''.$typeleaves[$obj->fk_type]['label'].''; $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; @@ -218,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) // Last expense report (old module) if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { - $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut"; + $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut, u.photo, d.rowid, d.dated as date, d.tms as dm, d.km, d.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE u.rowid = d.fk_user"; @@ -258,9 +261,12 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; + $userstatic->login=$obj->login; + $userstatic->statut=$obj->statut; + $userstatic->photo=$obj->photo; print ''; print ''.$deplacementstatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(1).''; + print ''.$userstatic->getNomUrl(-1).''; print ''.$obj->km.''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; print ''.$deplacementstatic->LibStatut($obj->fk_statut,3).''; @@ -282,7 +288,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) // Last expense report (new module) if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire) { - $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; + $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.statut, u.photo, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE u.rowid = x.fk_user_author"; @@ -322,9 +328,12 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $userstatic->id=$obj->uid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; + $userstatic->login=$obj->login; + $userstatic->statut=$obj->statut; + $userstatic->photo=$obj->photo; print ''; print ''.$expensereportstatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(1).''; + print ''.$userstatic->getNomUrl(-1).''; print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm),'day').''; print ''.$expensereportstatic->LibStatut($obj->status,3).''; diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index a9ce468a14c..cdcf633d458 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -329,6 +329,9 @@ ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DE ALTER TABLE llx_paiementfourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0; +ALTER TABLE llx_societe_remise ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; + +ALTER TABLE llx_societe_remise_except ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL; @@ -537,3 +540,7 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17804', 'Sociedad Civil', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178, '17805', 'Sociedad Anónima', 1); + +-- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL; + diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index f5f6a1cdf99..954cb3cc663 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -13,20 +13,23 @@ -- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex -- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y -- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y --- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE --- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; --- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; -- Note: fields with type BLOB/TEXT can't have default value. -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +DELETE FROM llx_menu where module='expensereport'; ALTER TABLE llx_user DROP COLUMN phenix_login; ALTER TABLE llx_user DROP COLUMN phenix_pass; ALTER TABLE llx_societe ADD COLUMN fk_account integer; +ALTER TABLE llx_commandedet ADD COLUMN fk_commandefourndet integer NOT NULL after import_key; -- link to detail line of commande fourn (resplenish) + ALTER TABLE llx_website ADD COLUMN virtualhost varchar(255) after fk_default_home; ALTER TABLE llx_chargesociales ADD COLUMN fk_account integer after fk_type; @@ -43,3 +46,26 @@ ALTER TABLE llx_notify ADD COLUMN type_target varchar(16) NULL; ALTER TABLE llx_entrepot DROP COLUMN valo_pmp; +ALTER TABLE llx_notify_def MODIFY COLUMN fk_soc integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_notify_def ALTER COLUMN fk_soc SET DEFAULT NULL; + + +create table llx_categorie_project +( + fk_categorie integer NOT NULL, + fk_project integer NOT NULL, + import_key varchar(14) +)ENGINE=innodb; + +ALTER TABLE llx_categorie_project ADD PRIMARY KEY pk_categorie_project (fk_categorie, fk_project); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_categorie (fk_categorie); +ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_project (fk_project); + +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid); +ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_fk_project_rowid FOREIGN KEY (fk_project) REFERENCES llx_projet (rowid); + +ALTER TABLE llx_societe_remise_except ADD COLUMN entity integer DEFAULT 1 NOT NULL after rowid; +ALTER TABLE llx_societe_remise ADD COLUMN entity integer DEFAULT 1 NOT NULL after rowid; + + + diff --git a/htdocs/install/mysql/tables/llx_commandedet.sql b/htdocs/install/mysql/tables/llx_commandedet.sql index 9608c2ae44b..ee407fe9cff 100644 --- a/htdocs/install/mysql/tables/llx_commandedet.sql +++ b/htdocs/install/mysql/tables/llx_commandedet.sql @@ -57,6 +57,8 @@ create table llx_commandedet fk_unit integer DEFAULT NULL, -- lien vers table des unités import_key varchar(14), + fk_commandefourndet integer NOT NULL, -- link to detail line of commande fourn (resplenish) + fk_multicurrency integer, multicurrency_code varchar(255), multicurrency_subprice double(24,8) DEFAULT 0, diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index fcf57ac28b6..667d512762d 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -33,7 +33,7 @@ CREATE TABLE llx_establishment ( profid3 varchar(20), phone varchar(20), fk_user_author integer NOT NULL, - fk_user_mod integer NOT NULL, + fk_user_mod integer, datec datetime NOT NULL, tms timestamp NOT NULL, status tinyint DEFAULT 1 diff --git a/htdocs/install/mysql/tables/llx_notify_def.sql b/htdocs/install/mysql/tables/llx_notify_def.sql index 28055c76cfe..a3fc123c8dd 100644 --- a/htdocs/install/mysql/tables/llx_notify_def.sql +++ b/htdocs/install/mysql/tables/llx_notify_def.sql @@ -1,5 +1,6 @@ -- =================================================================== -- Copyright (C) 2003 Rodolphe Quiedeville +-- Copyright (C) 2016 Laurent Destailleur -- -- 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 @@ -22,7 +23,7 @@ create table llx_notify_def tms timestamp, datec date, -- date de creation fk_action integer NOT NULL, - fk_soc integer NOT NULL, + fk_soc integer, fk_contact integer, fk_user integer, type varchar(16) DEFAULT 'email' diff --git a/htdocs/install/mysql/tables/llx_societe_remise.sql b/htdocs/install/mysql/tables/llx_societe_remise.sql index 14b4ea85639..a9d41fcd502 100644 --- a/htdocs/install/mysql/tables/llx_societe_remise.sql +++ b/htdocs/install/mysql/tables/llx_societe_remise.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2011 Regis Houssin +-- Copyright (C) 2011-2016 Regis Houssin -- -- 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 @@ -21,13 +21,14 @@ create table llx_societe_remise ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_soc integer NOT NULL, - tms timestamp, - datec datetime, -- creation date - fk_user_author integer, -- creation user - remise_client double(6,3) DEFAULT 0 NOT NULL, -- discount - note text + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer NOT NULL, + tms timestamp, + datec datetime, -- creation date + fk_user_author integer, -- creation user + remise_client double(6,3) DEFAULT 0 NOT NULL, -- discount + note text )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_societe_remise_except.sql b/htdocs/install/mysql/tables/llx_societe_remise_except.sql index f17d17670d2..4c55e34425c 100644 --- a/htdocs/install/mysql/tables/llx_societe_remise_except.sql +++ b/htdocs/install/mysql/tables/llx_societe_remise_except.sql @@ -21,18 +21,19 @@ create table llx_societe_remise_except ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_soc integer NOT NULL, -- client - datec datetime, - amount_ht double(24,8) NOT NULL, - amount_tva double(24,8) DEFAULT 0 NOT NULL, - amount_ttc double(24,8) DEFAULT 0 NOT NULL, - tva_tx double(6,3) DEFAULT 0 NOT NULL, - fk_user integer NOT NULL, - fk_facture_line integer, - fk_facture integer, - fk_facture_source integer, - description text NOT NULL, + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1 NOT NULL, -- multi company id + fk_soc integer NOT NULL, -- client + datec datetime, + amount_ht double(24,8) NOT NULL, + amount_tva double(24,8) DEFAULT 0 NOT NULL, + amount_ttc double(24,8) DEFAULT 0 NOT NULL, + tva_tx double(6,3) DEFAULT 0 NOT NULL, + fk_user integer NOT NULL, + fk_facture_line integer, + fk_facture integer, + fk_facture_source integer, + description text NOT NULL, multicurrency_amount_ht double(24,8) DEFAULT 0 NOT NULL, multicurrency_amount_tva double(24,8) DEFAULT 0 NOT NULL, multicurrency_amount_ttc double(24,8) DEFAULT 0 NOT NULL diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 74e3af98249..8db34216f18 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -397,27 +397,38 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) // Reload menus (this must be always and only into last targeted version) migrate_reload_menu($db,$langs,$conf,$versionto); } - + // Scripts for last version $afterversionarray=explode('.','3.9.9'); $beforeversionarray=explode('.','4.0.9'); if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) { migrate_directories($db,$langs,$conf,'/fckeditor','/medias'); - - // Reload modules (this must be always and only into last targeted version) - $listofmodule=array( - 'MAIN_MODULE_BARCODE'=>'newboxdefonly', - 'MAIN_MODULE_CRON'=>'newboxdefonly', - 'MAIN_MODULE_FACTURE'=>'newboxdefonly', - 'MAIN_MODULE_PRINTING'=>'newboxdefonly', - ); - migrate_reload_modules($db,$langs,$conf,$listofmodule); - - // Reload menus (this must be always and only into last targeted version) - migrate_reload_menu($db,$langs,$conf,$versionto); } + // Scripts for last version + $afterversionarray=explode('.','4.0.9'); + $beforeversionarray=explode('.','5.0.9'); + if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) + { + // Migrate to add entity value into llx_societe_remise + migrate_remise_entity($db,$langs,$conf); + + // Migrate to add entity value into llx_societe_remise_except + migrate_remise_except_entity($db,$langs,$conf); + + // Reload modules (this must be always and only into last targeted version) + $listofmodule=array( + 'MAIN_MODULE_BARCODE'=>'newboxdefonly', + 'MAIN_MODULE_CRON'=>'newboxdefonly', + 'MAIN_MODULE_FACTURE'=>'newboxdefonly', + 'MAIN_MODULE_PRINTING'=>'newboxdefonly', + ); + migrate_reload_modules($db,$langs,$conf,$listofmodule); + + // Reload menus (this must be always and only into last targeted version) + migrate_reload_menu($db,$langs,$conf,$versionto); + } // Can force activation of some module during migration with third paramater = MAIN_MODULE_XXX,MAIN_MODULE_YYY,... if ($enablemodules) @@ -431,8 +442,8 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) } migrate_reload_modules($db,$langs,$conf,$listofmodules,1); } - - + + print '
    '.$langs->trans("MigrationFinished").''; // On commit dans tous les cas. @@ -1329,10 +1340,10 @@ function migrate_paiementfourn_facturefourn($db,$langs,$conf) function migrate_price_facture($db,$langs,$conf) { $err=0; - + $tmpmysoc=new Societe($db); $tmpmysoc->setMysoc($conf); - + $db->begin(); print ''; @@ -1449,7 +1460,7 @@ function migrate_price_propal($db,$langs,$conf) { $tmpmysoc=new Societe($db); $tmpmysoc->setMysoc($conf); - + $db->begin(); print ''; @@ -1648,7 +1659,7 @@ function migrate_price_commande($db,$langs,$conf) $tmpmysoc=new Societe($db); $tmpmysoc->setMysoc($conf); - + print ''; print '
    '; @@ -1762,10 +1773,10 @@ function migrate_price_commande($db,$langs,$conf) function migrate_price_commande_fournisseur($db,$langs,$conf) { $db->begin(); - + $tmpmysoc=new Societe($db); $tmpmysoc->setMysoc($conf); - + print ''; print '
    '; @@ -3659,6 +3670,196 @@ function migrate_event_assignement($db,$langs,$conf) print ''; } +/** + * Migrate to add entity value into llx_societe_remise + * + * @param DoliDB $db Database handler + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @return void + */ +function migrate_remise_entity($db,$langs,$conf) +{ + print ''; + + print '
    '; + print ''.$langs->trans('MigrationRemiseEntity')."
    \n"; + + $error = 0; + + dolibarr_install_syslog("upgrade2::migrate_remise_entity"); + + $db->begin(); + + $sqlSelect = "SELECT sr.rowid, s.entity"; + $sqlSelect.= " FROM ".MAIN_DB_PREFIX."societe_remise as sr, ".MAIN_DB_PREFIX."societe as s"; + $sqlSelect.= " WHERE sr.fk_soc = s.rowid and sr.entity != s.entity"; + + //print $sqlSelect; + + $resql = $db->query($sqlSelect); + if ($resql) + { + $i = 0; + $num = $db->num_rows($resql); + + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."societe_remise SET"; + $sqlUpdate.= " entity = " . $obj->entity; + $sqlUpdate.= " WHERE rowid = " . $obj->rowid; + + $result=$db->query($sqlUpdate); + if (! $result) + { + $error++; + dol_print_error($db); + } + + print ". "; + $i++; + } + } + else + { + print $langs->trans('AlreadyDone')."
    \n"; + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db); + $db->rollback(); + } + + + print ''; +} + +/** + * Migrate to add entity value into llx_societe_remise_except + * + * @param DoliDB $db Database handler + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @return void + */ +function migrate_remise_except_entity($db,$langs,$conf) +{ + print ''; + + print '
    '; + print ''.$langs->trans('MigrationRemiseExceptEntity')."
    \n"; + + $error = 0; + + dolibarr_install_syslog("upgrade2::migrate_remise_except_entity"); + + $db->begin(); + + $sqlSelect = "SELECT sr.rowid, sr.fk_soc, sr.fk_facture_source, sr.fk_facture, sr.fk_facture_line"; + $sqlSelect.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr"; + //print $sqlSelect; + + $resql = $db->query($sqlSelect); + if ($resql) + { + $i = 0; + $num = $db->num_rows($resql); + + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + if (!empty($obj->fk_facture_source) || !empty($obj->fk_facture)) + { + $fk_facture = (!empty($obj->fk_facture_source) ? $obj->fk_facture_source : $obj->fk_facture); + + $sqlSelect2 = "SELECT f.entity"; + $sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sqlSelect2.= " WHERE f.rowid = " . $fk_facture; + } + else if (!empty($obj->fk_facture_line)) + { + $sqlSelect2 = "SELECT f.entity"; + $sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd"; + $sqlSelect2.= " WHERE fd.rowid = " . $obj->fk_facture_line; + $sqlSelect2.= " AND fd.fk_facture = f.rowid"; + } + else + { + $sqlSelect2 = "SELECT s.entity"; + $sqlSelect2.= " FROM ".MAIN_DB_PREFIX."societe as s"; + $sqlSelect2.= " WHERE s.rowid = " . $obj->fk_soc; + } + + $resql2 = $db->query($sqlSelect2); + if ($resql2) + { + if ($db->num_rows($resql2) > 0) + { + $obj2 = $db->fetch_object($resql2); + + $sqlUpdate = "UPDATE ".MAIN_DB_PREFIX."societe_remise_except SET"; + $sqlUpdate.= " entity = " . $obj2->entity; + $sqlUpdate.= " WHERE rowid = " . $obj->rowid; + + $result=$db->query($sqlUpdate); + if (! $result) + { + $error++; + dol_print_error($db); + } + } + } + else + { + $error++; + dol_print_error($db); + } + + print ". "; + $i++; + } + } + else + { + print $langs->trans('AlreadyDone')."
    \n"; + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db); + $db->rollback(); + } + + + print ''; +} + /** * Migration directory * @@ -3826,7 +4027,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled $mod=null; - + if ($moduletoreload == 'MAIN_MODULE_AGENDA') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module"); @@ -3999,7 +4200,7 @@ function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0) } if (! empty($mod) && is_object($mod)) - { + { print ''; print ''.$langs->trans('Upgrade').': '; print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated @@ -4031,7 +4232,7 @@ function migrate_reload_menu($db,$langs,$conf,$versionto) $versiontoarray=explode('.',$versionto); - // Migration required when target version is between + // Migration required when target version is between $afterversionarray=explode('.','2.8.9'); $beforeversionarray=explode('.','2.9.9'); if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) @@ -4039,7 +4240,7 @@ function migrate_reload_menu($db,$langs,$conf,$versionto) $listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers } - // Migration required when target version is between + // Migration required when target version is between $afterversionarray=explode('.','3.1.9'); $beforeversionarray=explode('.','3.2.9'); if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0) @@ -4054,7 +4255,7 @@ function migrate_reload_menu($db,$langs,$conf,$versionto) { $listofmenuhandler['auguria']=1; // We set here only dynamic menu handlers } - + foreach ($listofmenuhandler as $key => $val) { print ''; diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index 7a74e18dbf0..b92401e009e 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=اسم الملف ومسار YouCanUseDOL_DATA_ROOT=يمكنك استخدام DOL_DATA_ROOT / dolibarr.log لملف الدخول في Dolibarr "وثائق" دليل. يمكنك أن تحدد مسارا مختلفا لتخزين هذا الملف. ErrorUnknownSyslogConstant=ثابت %s ليس ثابت سيسلوغ معروفة OnlyWindowsLOG_USER=نوافذ يعتمد فقط LOG_USER -SyslogSentryDSN=ترقب DSN -SyslogSentryFromProject=DSN من مشروع ترقب بك ##### Donations ##### DonationsSetup=وحدة الإعداد للتبرع DonationsReceiptModel=قالب من استلام التبرع diff --git a/htdocs/langs/bg_BG/admin.lang b/htdocs/langs/bg_BG/admin.lang index f67745edb12..9b158ca8a6d 100644 --- a/htdocs/langs/bg_BG/admin.lang +++ b/htdocs/langs/bg_BG/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Име на файла и пътя YouCanUseDOL_DATA_ROOT=Можете да използвате DOL_DATA_ROOT / dolibarr.log за лог файл в Dolibarr директория "документи". Можете да зададете различен път, за да се съхранява този файл. ErrorUnknownSyslogConstant=Постоянни %s не е известен Syslog постоянно OnlyWindowsLOG_USER=Windows поддържа само LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Настройка на модул Дарение DonationsReceiptModel=Шаблон на получаване на дарение diff --git a/htdocs/langs/bn_BD/admin.lang b/htdocs/langs/bn_BD/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/bn_BD/admin.lang +++ b/htdocs/langs/bn_BD/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/bs_BA/admin.lang b/htdocs/langs/bs_BA/admin.lang index 68d33510781..66732bca8db 100644 --- a/htdocs/langs/bs_BA/admin.lang +++ b/htdocs/langs/bs_BA/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 190e14dca05..7cb8f45783a 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nom i ruta de l'arxiu YouCanUseDOL_DATA_ROOT=Utilitza DOL_DATA_ROOT/dolibarr.log per un fitxer de registre en la carpeta documents de Dolibarr. Tanmateix, es pot definir una carpeta diferent per guardar aquest fitxer. ErrorUnknownSyslogConstant=La constant %s no és una constant syslog coneguda OnlyWindowsLOG_USER=Windows només suporta LOG_USER -SyslogSentryDSN=DSN Sentry -SyslogSentryFromProject=DSN del teu projecte Sentry ##### Donations ##### DonationsSetup=Configuració del mòdul donacions DonationsReceiptModel=Plantilla de rebut de donació diff --git a/htdocs/langs/cs_CZ/admin.lang b/htdocs/langs/cs_CZ/admin.lang index 78fa7604ba5..aec2797976b 100644 --- a/htdocs/langs/cs_CZ/admin.lang +++ b/htdocs/langs/cs_CZ/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Název souboru a cesta YouCanUseDOL_DATA_ROOT=Můžete použít DOL_DATA_ROOT / dolibarr.log pro soubor protokolu Dolibarr "Dokumenty" adresáře. Můžete nastavit jinou cestu k uložení tohoto souboru. ErrorUnknownSyslogConstant=Konstantní %s není známo, Syslog konstantní OnlyWindowsLOG_USER=Windows podporuje pouze LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Darování modul nastavení DonationsReceiptModel=Vzor darovací přijetí diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index 225979662f6..5d66d64c891 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Filnavn og sti YouCanUseDOL_DATA_ROOT=Du kan bruge DOL_DATA_ROOT / dolibarr.log for en logfil i Dolibarr "dokumenter" mappen. Du kan indstille en anden vej til at gemme denne fil. ErrorUnknownSyslogConstant=Konstant %s er ikke en kendt syslog konstant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation modul opsætning DonationsReceiptModel=Skabelon for donationen modtagelse diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 974c8973461..4697482aa28 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Dateiname und-pfad YouCanUseDOL_DATA_ROOT=Sie können DOL_DATA_ROOT/dolibarr.log als Protokolldatei in Ihrem Dokumentenverzeichnis verwenden. Bei Bedarf können Sie auch den Pfad der Datei anpassen. ErrorUnknownSyslogConstant=Konstante %s ist nicht als Protokoll-Konstante definiert OnlyWindowsLOG_USER=Windows unterstützt nur LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN Ihres Sentry Projekts ##### Donations ##### DonationsSetup=Spendenmoduleinstellungen DonationsReceiptModel=Vorlage für Spendenquittungen diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index a433818e4a6..5413158e27c 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index a663d683fe3..3c8a431fbb6 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -56,7 +56,8 @@ ACCOUNTING_LENGTH_DESCRIPTION=Length for displaying product & services descripti ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Length for displaying product & services account description form in listings (Best = 50) ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts -ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function of length of the accounts. +ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function "length of the accounts". +BANK_DISABLE_DIRECT_INPUT=Disable free input of bank transactions. Enable by default with this module. ACCOUNTING_SELL_JOURNAL=Sell journal ACCOUNTING_PURCHASE_JOURNAL=Purchase journal @@ -158,6 +159,8 @@ OptionModeProductSell=Mode sales OptionModeProductBuy=Mode purchases OptionModeProductSellDesc=Show all products with no accounting account defined for sales. OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases. +CleanFixHistory=Remove accountancy code from lines that not exists into charts of account +CleanHistory=Reset all accountancy for selected year ## Dictionary Range=Range of accounting account diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1e2e3e68291..ebac37ce6d8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1037,9 +1037,17 @@ SendmailOptionNotComplete=Warning, on some Linux systems, to send email from you PathToDocuments=Path to documents PathDirectory=Directory SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages. -TranslationSetup=Configuration de la traduction -TranslationDesc=How to set displayed application language
    * Systemwide: menu Home - Setup - Display
    * Per user: User display setup tab of user card (click on username at the top of the screen). -TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the key string found in the lang file (langs/xx_XX/somefile.lang) into "%s" and your new translation into "%s". +TranslationSetup=Setup of translation +TranslationKeySearch=Search a translation key or string +TranslationOverwriteKey=Overwrite a translation string +TranslationDesc=How to set displayed application language :
    * Systemwide: menu Home - Setup - Display
    * Per user: User display setup tab of user card (click on username at the top of the screen). +TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the translation key string into "%s" and your new translation into "%s" +TranslationOverwriteDesc2=You can use the other tab to help you know translation key to use +TranslationString=Translation string +CurrentTranslationString=Current translation string +WarningAtLeastKeyOrTranslationRequired=A search criteria is required at least for key or translation string +NewTranslationStringToShow=New translation string to show +OriginalValueWas=The original translation is overwritten. Original value was:

    %s TotalNumberOfActivatedModules=Total number of activated feature modules: %s / %s YouMustEnableOneModule=You must at least enable 1 module ClassNotFoundIntoPathWarning=Class %s not found into PHP path @@ -1319,8 +1327,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 819664dfdc4..b0b7af4076f 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -78,6 +78,7 @@ AccountToCredit=Account to credit AccountToDebit=Account to debit DisableConciliation=Disable reconciliation feature for this account ConciliationDisabled=Reconciliation feature disabled +LinkedToAConciliatedTransaction=Linked to a conciliated transaction StatusAccountOpened=Open StatusAccountClosed=Closed AccountIdShort=Number diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index f07b069e031..a4d4e6f99f5 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -381,6 +381,7 @@ ExtraInfos=Extra infos RegulatedOn=Regulated on ChequeNumber=Check N° ChequeOrTransferNumber=Check/Transfer N° +ChequeBordereau=Check schedule ChequeMaker=Check/Transfer transmitter ChequeBank=Bank of Check CheckBank=Check @@ -429,6 +430,7 @@ CantRemoveConciliatedPayment=Can't remove conciliated payment PayedByThisPayment=Paid by this payment ClosePaidInvoicesAutomatically=Classify "Paid" all standard, situation or replacement invoices entirely paid. ClosePaidCreditNotesAutomatically=Classify "Paid" all credit notes entirely paid back. +ClosePaidContributionsAutomatically=Classify "Paid" all social or fiscal contributions entirely paid. AllCompletelyPayedInvoiceWillBeClosed=All invoice with no remain to pay will be automatically closed to status "Paid". ToMakePayment=Pay ToMakePaymentBack=Pay back diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 2e85ba36f1f..98970318e85 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -38,7 +38,7 @@ BoxMyLastBookmarks=My latest %s bookmarks BoxOldestExpiredServices=Oldest active expired services BoxLastExpiredServices=Latest %s oldest contacts with active expired services BoxTitleLastActionsToDo=Latest %s actions to do -BoxTitleLastContracts=Latest %s contracts +BoxTitleLastContracts=Latest %s modified contracts BoxTitleLastModifiedDonations=Latest %s modified donations BoxTitleLastModifiedExpenses=Latest %s modified expense reports BoxGlobalActivity=Global activity (invoices, proposals, orders) @@ -81,4 +81,4 @@ ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders ForProposals=Proposals LastXMonthRolling=The latest %s month rolling -ChooseBoxToAdd=Add widget to your dashboard... +ChooseBoxToAdd=Add widget to your dashboard diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 0261c0550cc..69db60c0cc3 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -14,7 +14,7 @@ ShoppingCart=Shopping cart NewSell=New sell AddThisArticle=Add this article RestartSelling=Go back on sell -SellFinished=Sell finished +SellFinished=Sale complete PrintTicket=Print ticket NoProductFound=No article found ProductFound=product found diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 976c8a50d93..1008cd5bd68 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -14,6 +14,7 @@ CustomersCategoriesArea=Customers tags/categories area MembersCategoriesArea=Members tags/categories area ContactsCategoriesArea=Contacts tags/categories area AccountsCategoriesArea=Accounts tags/categories area +ProjectsCategoriesArea=Projects tags/categories area SubCats=Subcategories CatList=List of tags/categories NewCategory=New tag/category @@ -36,6 +37,7 @@ ProductHasNoCategory=This product/service is not in any tags/categories CompanyHasNoCategory=This thirdparty is not in any tags/categories MemberHasNoCategory=This member is not in any tags/categories ContactHasNoCategory=This contact is not in any tags/categories +ProjectHasNoCategory=This project is not in any tags/categories ClassifyInCategory=Add to tag/category NotCategorized=Without tag/category CategoryExistsAtSameLevel=This category already exists with this ref @@ -56,12 +58,14 @@ ProductsCategoriesShort=Products tags/categories MembersCategoriesShort=Members tags/categories ContactCategoriesShort=Contacts tags/categories AccountsCategoriesShort=Accounts tags/categories +ProjectsCategoriesShort=Projects tags/categories ThisCategoryHasNoProduct=This category does not contain any product. ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoCustomer=This category does not contain any customer. ThisCategoryHasNoMember=This category does not contain any member. ThisCategoryHasNoContact=This category does not contain any contact. ThisCategoryHasNoAccount=This category does not contain any account. +ThisCategoryHasNoProject=This category does not contain any project. CategId=Tag/category id CatSupList=List of supplier tags/categories CatCusList=List of customer/prospect tags/categories @@ -71,6 +75,7 @@ CatContactList=List of contact tags/categories CatSupLinks=Links between suppliers and tags/categories CatCusLinks=Links between customers/prospects and tags/categories CatProdLinks=Links between products/services and tags/categories +CatProJectLinks=Links between projects and tags/categories DeleteFromCat=Remove from tags/category ExtraFieldsCategories=Complementary attributes CategoriesSetup=Tags/categories setup diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 9f2b9bdd516..5cca989d65e 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -261,6 +261,7 @@ AddContactAddress=Create contact/address EditContact=Edit contact EditContactAddress=Edit contact/address Contact=Contact +ContactId=Contact id ContactsAddresses=Contacts/Addresses NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefined=No contact defined @@ -353,9 +354,9 @@ ExportCardToFormat=Export card to format ContactNotLinkedToCompany=Contact not linked to any third party DolibarrLogin=Dolibarr login NoDolibarrAccess=No Dolibarr access -ExportDataset_company_1=Third parties (Companies/foundations/physical people) and properties +ExportDataset_company_1=Third parties (Companies / foundations / physical people) and properties ExportDataset_company_2=Contacts and properties -ImportDataset_company_1=Third parties (Companies/foundations/physical people) and properties +ImportDataset_company_1=Third parties (Companies / foundations / physical people) and properties ImportDataset_company_2=Contacts/Addresses (of thirdparties or not) and attributes ImportDataset_company_3=Bank details ImportDataset_company_4=Third parties/Sales representatives (Affect sales representatives users to companies) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 13433dcac3f..3a7cd41386f 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -49,6 +49,8 @@ SocialContribution=Social or fiscal tax SocialContributions=Social or fiscal taxes SocialContributionsDeductibles=Deductible social or fiscal taxes SocialContributionsNondeductibles=Nondeductible social or fiscal taxes +LabelContrib=Label contribution +TypeContrib=Type contribution MenuSpecialExpenses=Special expenses MenuTaxAndDividends=Taxes and dividends MenuSocialContributions=Social/fiscal taxes diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index acbb0e286b9..0462b4d1dc9 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -174,6 +174,7 @@ ErrorStockIsNotEnoughToAddProductOnOrder=Stock is not enougth for product %s to ErrorStockIsNotEnoughToAddProductOnInvoice=Stock is not enougth for product %s to add it into a new invoice. ErrorStockIsNotEnoughToAddProductOnShipment=Stock is not enougth for product %s to add it into a new shipment. ErrorStockIsNotEnoughToAddProductOnProposal=Stock is not enougth for product %s to add it into a new proposal. +ErrorFailedToLoadLoginFileForMode=Failed to get the login file for mode '%s'. # Warnings WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 69711cb77cc..cbe453ef245 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -191,6 +191,8 @@ MigrationActioncommElement=Update data on actions MigrationPaymentMode=Data migration for payment mode MigrationCategorieAssociation=Migration of categories MigrationEvents=Migration of events to add event owner into assignement table +MigrationRemiseEntity=Update entity field value of llx_societe_remise +MigrationRemiseExceptEntity=Update entity field value of llx_societe_remise_except MigrationReloadModule=Reload module %s ShowNotAvailableOptions=Show not available options HideNotAvailableOptions=Hide not available options diff --git a/htdocs/langs/en_US/multicurrency.lang b/htdocs/langs/en_US/multicurrency.lang index b75942ebb44..10d84a5edc6 100644 --- a/htdocs/langs/en_US/multicurrency.lang +++ b/htdocs/langs/en_US/multicurrency.lang @@ -1,4 +1,5 @@ -# ADMIN +# Dolibarr language file - Source file is en_US - multicurrency +MultiCurrency=Multi currency ErrorAddRateFail=Error in added rate ErrorAddCurrencyFail=Error in added currency ErrorDeleteCurrencyFail=Error delete fail diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8c23135ddbd..a190d86dcc9 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -153,7 +153,7 @@ PlannedWorkload=Planned workload PlannedWorkloadShort=Workload ProjectReferers=Related items ProjectMustBeValidatedFirst=Project must be validated first -FirstAddRessourceToAllocateTime=Associate a resource to allocate time +FirstAddRessourceToAllocateTime=Assign a user resource to task to allocate time InputPerDay=Input per day InputPerWeek=Input per week InputPerAction=Input per action diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 909a4d713c1..e39a69a3dbe 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -47,6 +47,7 @@ DefaultModelSupplierProposalCreate=Default model creation DefaultModelSupplierProposalToBill=Default template when closing a price request (accepted) DefaultModelSupplierProposalClosed=Default template when closing a price request (refused) ListOfSupplierProposal=List of supplier proposal requests +ListSupplierProposalsAssociatedProject=List of supplier proposals associated with project SupplierProposalsToClose=Supplier proposals to close SupplierProposalsToProcess=Supplier proposals to process LastSupplierProposals=Last price requests diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index ec2ff713c14..51b0257dc74 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nombre y ruta del archivo YouCanUseDOL_DATA_ROOT=Puede utilizar DOL_DATA_ROOT/dolibarr.log para un registro en el directorio "documentos" de Dolibarr. Sin embargo, puede establecer un directorio diferente para guardar este archivo. ErrorUnknownSyslogConstant=La constante %s no es una constante syslog conocida OnlyWindowsLOG_USER=Windows sólo soporta LOG_USER -SyslogSentryDSN=DSN Sentry -SyslogSentryFromProject=DSN de su proyecto Sentry ##### Donations ##### DonationsSetup=Configuración del módulo donaciones DonationsReceiptModel=Modelo recepción de donaciones diff --git a/htdocs/langs/et_EE/admin.lang b/htdocs/langs/et_EE/admin.lang index 6f9fb7889f5..3a80b113e4f 100644 --- a/htdocs/langs/et_EE/admin.lang +++ b/htdocs/langs/et_EE/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Faili nimi ja rada YouCanUseDOL_DATA_ROOT=Võid kasutada DOL_DATA_ROOT/dolibarr.log Dolibarri "documents" kausta faili salvestamiseks, aga logifaili salvestamiseks võib ka mõnda muud rada kasutada. ErrorUnknownSyslogConstant=Konstant %s ei ole tuntud Syslogi konstant OnlyWindowsLOG_USER=Windows toetab vaid LOG_USER direktiivi -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Annetuste mooduli seadistamine DonationsReceiptModel=Annetuse kviitungi mall diff --git a/htdocs/langs/eu_ES/admin.lang b/htdocs/langs/eu_ES/admin.lang index 3b21ebfb0c2..5bc663a9acc 100644 --- a/htdocs/langs/eu_ES/admin.lang +++ b/htdocs/langs/eu_ES/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Fitxategiaren izena eta kokapena YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=%s konstantea ez da Syslog-eko konstante ezaguna OnlyWindowsLOG_USER=Windows-ek LOG_USER soilik jasaten du -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index a17c57bf92e..b88f676ba69 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=نام فایل و مسیر YouCanUseDOL_DATA_ROOT=شما می توانید DOL_DATA_ROOT / dolibarr.log برای یک فایل در "اسناد" Dolibarr دایرکتوری استفاده کنید. شما می توانید راه های مختلفی را برای ذخیره این فایل را. ErrorUnknownSyslogConstant=٪ ثابت است ثابت های Syslog شناخته نشده است OnlyWindowsLOG_USER=ویندوز تنها پشتیبانی از LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=راه اندازی ماژول کمک مالی DonationsReceiptModel=الگو از دریافت کمک مالی diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index 29baca03280..d9a48ec6121 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Tiedoston nimi ja polku YouCanUseDOL_DATA_ROOT=Voit käyttää DOL_DATA_ROOT / dolibarr.log varten lokitiedoston Dolibarr "asiakirjoihin" hakemistoon. Voit valita eri reitin tallentaa tiedoston. ErrorUnknownSyslogConstant=Constant %s ei ole tunnettu syslog vakio OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Lahjoitus-moduulin asetukset DonationsReceiptModel=Malline lahjoituksen vastaanottamisesta diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0c73888ac90..5be0bbcd50c 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nom et chemin du fichier YouCanUseDOL_DATA_ROOT=Vous pouvez utiliser DOL_DATA_ROOT/dolibarr.log pour un journal dans le répertoire "documents" de Dolibarr. Vous pouvez néanmoins définir un chemin différent pour stocker ce fichier. ErrorUnknownSyslogConstant=La constante %s n'est pas une constante syslog connue OnlyWindowsLOG_USER=Windows ne prend en charge que LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN de votre projet Sentry ##### Donations ##### DonationsSetup=Configuration du module Dons DonationsReceiptModel=Modèles de reçu de dons diff --git a/htdocs/langs/he_IL/admin.lang b/htdocs/langs/he_IL/admin.lang index 0ae7e3087e7..b541eb5535c 100644 --- a/htdocs/langs/he_IL/admin.lang +++ b/htdocs/langs/he_IL/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=שם קובץ ונתיב YouCanUseDOL_DATA_ROOT=ניתן להשתמש DOL_DATA_ROOT / dolibarr.log עבור קובץ יומן בספרייה Dolibarr "מסמכים". ניתן להגדיר בדרך אחרת כדי לאחסן קובץ זה. ErrorUnknownSyslogConstant=%s קבועים אינו ידוע Syslog מתמיד OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=מודול תרומה ההתקנה DonationsReceiptModel=תבנית של קבלת תרומה diff --git a/htdocs/langs/hr_HR/admin.lang b/htdocs/langs/hr_HR/admin.lang index 370eba7890f..23bcba937c3 100644 --- a/htdocs/langs/hr_HR/admin.lang +++ b/htdocs/langs/hr_HR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/hu_HU/admin.lang b/htdocs/langs/hu_HU/admin.lang index a415e54b2db..68de4a4e997 100644 --- a/htdocs/langs/hu_HU/admin.lang +++ b/htdocs/langs/hu_HU/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=A fájl nevét és elérési útvonalát YouCanUseDOL_DATA_ROOT=Használhatja DOL_DATA_ROOT / dolibarr.log egy log fájlt Dolibarr "Dokumentumok" mappa. Beállíthatjuk, más utat kell tárolni ezt a fájlt. ErrorUnknownSyslogConstant=Constant %s nem ismert Syslog állandó OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Adomány modul beállítása DonationsReceiptModel=Sablon az adomány átvételét diff --git a/htdocs/langs/id_ID/admin.lang b/htdocs/langs/id_ID/admin.lang index 9eeb4336aee..76e5c7dd3cf 100644 --- a/htdocs/langs/id_ID/admin.lang +++ b/htdocs/langs/id_ID/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index 0e0003a5055..719f3db339c 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Skráarnafn og slóði YouCanUseDOL_DATA_ROOT=Þú getur notað DOL_DATA_ROOT / dolibarr.log fyrir annálinn í Dolibarr "skjöl" skrá. Þú getur stillt mismunandi leið til að geyma þessa skrá. ErrorUnknownSyslogConstant=Constant %s er ekki þekktur skrifað fasti OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Safnast mát skipulag DonationsReceiptModel=Snið af málefnið berst diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index f6d4abf3002..db056af6da2 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nome file e percorso YouCanUseDOL_DATA_ROOT=È possibile utilizzare DOL_DATA_ROOT/dolibarr.log come file di log per la directory "documenti". È anche possibile impostare un percorso diverso per tale file. ErrorUnknownSyslogConstant=La costante %s è sconosciuta a syslog. OnlyWindowsLOG_USER=Solo utenti Windows supportano LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Impostazioni modulo donazioni DonationsReceiptModel=Modello di ricevuta per donazioni diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index 175e20bd67d..496ae5e2ad0 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=ファイル名とパス YouCanUseDOL_DATA_ROOT=あなたがDolibarr "ドキュメント"ディレクトリ内のログ·ファイルのDOL_DATA_ROOT / dolibarr.logを使用することができます。このファイルを格納する別のパスを設定することができます。 ErrorUnknownSyslogConstant=定数%sは知られているSyslogの定数ではありません。 OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=寄付モジュールのセットアップ DonationsReceiptModel=寄付金の領収書のテンプレート diff --git a/htdocs/langs/ka_GE/admin.lang b/htdocs/langs/ka_GE/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/ka_GE/admin.lang +++ b/htdocs/langs/ka_GE/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/kn_IN/admin.lang b/htdocs/langs/kn_IN/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/kn_IN/admin.lang +++ b/htdocs/langs/kn_IN/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/ko_KR/admin.lang b/htdocs/langs/ko_KR/admin.lang index 59589ffdb76..51c3ca83ff9 100644 --- a/htdocs/langs/ko_KR/admin.lang +++ b/htdocs/langs/ko_KR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/lo_LA/admin.lang b/htdocs/langs/lo_LA/admin.lang index f58f571f022..3fe74658f4a 100644 --- a/htdocs/langs/lo_LA/admin.lang +++ b/htdocs/langs/lo_LA/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/lt_LT/admin.lang b/htdocs/langs/lt_LT/admin.lang index 3f397d6d39c..4b49ffdbcbc 100644 --- a/htdocs/langs/lt_LT/admin.lang +++ b/htdocs/langs/lt_LT/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Failo pavadinimas ir kelias YouCanUseDOL_DATA_ROOT=Galite naudoti DOL_DATA_ROOT/dolibarr.log prisijungimo failui Dolibarr "dokuments" kataloge. Galite nustatyti kitokį kelią šio failo saugojimui. ErrorUnknownSyslogConstant=Konstanta %s yra nežinoma Syslog konstanta OnlyWindowsLOG_USER=Windows palaiko tik LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Aukų modulio nuostatos DonationsReceiptModel=Aukų įplaukų šablonas diff --git a/htdocs/langs/lv_LV/admin.lang b/htdocs/langs/lv_LV/admin.lang index ebc4a8edb17..b93c6b2b825 100644 --- a/htdocs/langs/lv_LV/admin.lang +++ b/htdocs/langs/lv_LV/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Faila nosaukums un ceļš YouCanUseDOL_DATA_ROOT=Jūs varat izmantot DOL_DATA_ROOT / dolibarr.log uz log failu Dolibarr "dokumenti" direktorijā. Jūs varat iestatīt citu ceļu, lai saglabātu šo failu. ErrorUnknownSyslogConstant=Constant %s nav zināms Syslog konstante OnlyWindowsLOG_USER=Windows atbalsta tikai LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Ziedojumu moduļa uzstādīšana DonationsReceiptModel=Veidne ziedojuma saņemšanu diff --git a/htdocs/langs/mk_MK/admin.lang b/htdocs/langs/mk_MK/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/mk_MK/admin.lang +++ b/htdocs/langs/mk_MK/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index 7c027be7c10..a2dc14f9c2c 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Filnavn og bane YouCanUseDOL_DATA_ROOT=Du kan bruke DOL_DATA_ROOT / dolibarr.log som loggfil i Dolibarr "dokumenter"-mappen. Du kan angi en annen bane for å lagre denne filen. ErrorUnknownSyslogConstant=Konstant %s er ikke en kjent syslog-konstant OnlyWindowsLOG_USER=Windows støtter bare LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN fra ditt Sentry-prosjekt ##### Donations ##### DonationsSetup=Oppsett av Donasjonsmodulen DonationsReceiptModel=Mal for donasjonskvittering diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index 2608b70280c..3e628eef6e1 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Bestandsnaam en -pad YouCanUseDOL_DATA_ROOT=U kunt DOL_DATA_ROOT/dolibarr.log gebruiken voor een logbestand in de Dolibarr "documenten"-map. U kunt ook een ander pad gebruiken om dit bestand op te slaan. ErrorUnknownSyslogConstant=Constante %s is geen bekende 'syslog' constante OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donatiemoduleinstellingen DonationsReceiptModel=Sjabloon van donatie-ontvangst diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index 92efc057076..8b247add6c7 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nazwa pliku i ścieżka YouCanUseDOL_DATA_ROOT=Możesz użyć DOL_DATA_ROOT / dolibarr.log do pliku w Dolibarr "dokumenty" katalogu. Można ustawić inną ścieżkę do przechowywania tego pliku. ErrorUnknownSyslogConstant=Stała %s nie jest znany syslog stałej OnlyWindowsLOG_USER=System Windows obsługuje tylko LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Darowizna konfiguracji modułu DonationsReceiptModel=Szablon otrzymania wpłaty diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index f0cf4fd2bc1..2b58d946b27 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -1011,7 +1011,6 @@ SyslogFilename=Nome do arquivo e caminho YouCanUseDOL_DATA_ROOT=Você pode usar DOL_DATA_ROOT/dolibarr.log para um arquivo de log no diretório dos "documentos" do Dolibarr. ErrorUnknownSyslogConstant=A Constante %s não é conhecida pelas constantes do Syslog OnlyWindowsLOG_USER=Somente Windows suporta LOG_USER -SyslogSentryFromProject=DSN do seu projeto Sentry DonationsSetup=Configurações do módulo de doações DonationsReceiptModel=Templates de recibos de doação BarcodeSetup=Configurações de código de barras diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang index 584e47a4f2a..affbb454602 100644 --- a/htdocs/langs/pt_PT/admin.lang +++ b/htdocs/langs/pt_PT/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nome e caminho do Ficheiro YouCanUseDOL_DATA_ROOT=Pode utilizar DOL_DATA_ROOT/dolibarr.log para um log na pasta 'documentos' de Dolibarr. ErrorUnknownSyslogConstant=A constante %s não é uma constante syslog conhecida OnlyWindowsLOG_USER=O Windows suporta apenas LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Configuração do módulo Bolsas DonationsReceiptModel=Modelo de recibo de doação diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index d924f083038..d5e6a80bb97 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Nume fişier şi calea YouCanUseDOL_DATA_ROOT=Puteţi folosi DOL_DATA_ROOT / dolibarr.log pentru un fişier de log în Dolibarr "Documente" director. Aveţi posibilitatea să setaţi o altă cale de a păstra acest fişier. ErrorUnknownSyslogConstant=Constant %s nu este un cunoscut syslog constant OnlyWindowsLOG_USER=Windows suportă numai LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donatii modul de configurare DonationsReceiptModel=Format de donatie la primirea diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index f0aa1c1c573..fa286e546d8 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Имя файла и путь YouCanUseDOL_DATA_ROOT=Вы можете использовать DOL_DATA_ROOT / dolibarr.log в лог-файл в Dolibarr "документы" каталог. Вы можете установить различные пути для хранения этого файла. ErrorUnknownSyslogConstant=Постоянная %s не известны журнала постоянная OnlyWindowsLOG_USER=Windows© поддерживает только LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Пожертвования модуль настройки DonationsReceiptModel=Шаблон дарения получения diff --git a/htdocs/langs/sk_SK/admin.lang b/htdocs/langs/sk_SK/admin.lang index 1e5387da6a9..c7df3c85e6c 100644 --- a/htdocs/langs/sk_SK/admin.lang +++ b/htdocs/langs/sk_SK/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Názov súboru a cesta YouCanUseDOL_DATA_ROOT=Môžete použiť DOL_DATA_ROOT / dolibarr.log pre súbor denníka Dolibarr "Dokumenty" adresára. Môžete nastaviť inú cestu na uloženie tohto súboru. ErrorUnknownSyslogConstant=Konštantná %s nie je známe, Syslog konštantný OnlyWindowsLOG_USER=Windows podporuje iba LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Darovanie modul nastavenia DonationsReceiptModel=Vzor darovacej prijatie diff --git a/htdocs/langs/sl_SI/admin.lang b/htdocs/langs/sl_SI/admin.lang index a13d9171f52..93fa19d44be 100644 --- a/htdocs/langs/sl_SI/admin.lang +++ b/htdocs/langs/sl_SI/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Ime datoteke in pot YouCanUseDOL_DATA_ROOT=Za log datoteko v Dolibarr dokumentni mapi lahko uporabite DOL_DATA_ROOT/dolibarr.log. Za shranjevanje te datoteke lahko nastavite tudi drugačno pot. ErrorUnknownSyslogConstant=Konstanta %s ni znana syslog konstanta OnlyWindowsLOG_USER=Windowsi podpirajo samo LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Nastanitev modula za donacije DonationsReceiptModel=Predloga računa za donacijo diff --git a/htdocs/langs/sq_AL/admin.lang b/htdocs/langs/sq_AL/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/sq_AL/admin.lang +++ b/htdocs/langs/sq_AL/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/sr_RS/admin.lang b/htdocs/langs/sr_RS/admin.lang index 4734f844851..48d8543e48a 100644 --- a/htdocs/langs/sr_RS/admin.lang +++ b/htdocs/langs/sr_RS/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN iz Vašeg Sentry projekta ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/sv_SE/admin.lang b/htdocs/langs/sv_SE/admin.lang index 74d9efbb531..c5952bf4c84 100644 --- a/htdocs/langs/sv_SE/admin.lang +++ b/htdocs/langs/sv_SE/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Filnamn och sökväg YouCanUseDOL_DATA_ROOT=Du kan använda DOL_DATA_ROOT / dolibarr.log för en loggfil i Dolibarr "dokument" katalogen. Du kan ställa in en annan väg för att lagra den här filen. ErrorUnknownSyslogConstant=Konstant %s är inte en känd syslog konstant OnlyWindowsLOG_USER=Endast Windows stöder LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation modul setup DonationsReceiptModel=Mall för donation kvitto diff --git a/htdocs/langs/sw_SW/admin.lang b/htdocs/langs/sw_SW/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/sw_SW/admin.lang +++ b/htdocs/langs/sw_SW/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/th_TH/admin.lang b/htdocs/langs/th_TH/admin.lang index b4b77a62b42..7d084ae4a6f 100644 --- a/htdocs/langs/th_TH/admin.lang +++ b/htdocs/langs/th_TH/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=ชื่อแฟ้มและเส้นทาง YouCanUseDOL_DATA_ROOT=คุณสามารถใช้ DOL_DATA_ROOT / dolibarr.log สำหรับล็อกไฟล์ใน Dolibarr "เอกสาร" ไดเรกทอรี คุณสามารถตั้งค่าเส้นทางที่แตกต่างกันในการจัดเก็บไฟล์นี้ ErrorUnknownSyslogConstant=% s คงไม่ได้เป็นที่รู้จักกันอย่างต่อเนื่อง Syslog OnlyWindowsLOG_USER=Windows เท่านั้นสนับสนุน LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=บริจาคการติดตั้งโมดูล DonationsReceiptModel=แม่แบบที่ได้รับการบริจาค diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang index 012d30e7f6c..13b648f434a 100644 --- a/htdocs/langs/tr_TR/admin.lang +++ b/htdocs/langs/tr_TR/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Dosya adı ve yolu YouCanUseDOL_DATA_ROOT=Dolibarr’daki “belgeler” dizinindeki bir log (günlük) dosyası için DOL_DATA_ROOT/dolibarr.log u kullanabilirsiniz. Bu dosyayı saklamak için farklı bir yol (path) kullanabilirsiniz. ErrorUnknownSyslogConstant=%s Değişmezi bilinen bir Syslog değişmezi değildir OnlyWindowsLOG_USER=Windows yalnızca LOG_USER'ı destekler -SyslogSentryDSN=Nöbetçi DSN -SyslogSentryFromProject=Nöbetçi projenizdeki DSN ##### Donations ##### DonationsSetup=Bağış modülü kurulumu DonationsReceiptModel=Bağış makbuzu şablonu diff --git a/htdocs/langs/uk_UA/admin.lang b/htdocs/langs/uk_UA/admin.lang index bd02e55c41e..7545c888763 100644 --- a/htdocs/langs/uk_UA/admin.lang +++ b/htdocs/langs/uk_UA/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/uz_UZ/admin.lang b/htdocs/langs/uz_UZ/admin.lang index f6a9f3010da..af313850ba1 100644 --- a/htdocs/langs/uz_UZ/admin.lang +++ b/htdocs/langs/uz_UZ/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=File name and path YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Donation module setup DonationsReceiptModel=Template of donation receipt diff --git a/htdocs/langs/vi_VN/admin.lang b/htdocs/langs/vi_VN/admin.lang index 8d861787181..3a399186d22 100644 --- a/htdocs/langs/vi_VN/admin.lang +++ b/htdocs/langs/vi_VN/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=Tên tập tin và đường dẫn YouCanUseDOL_DATA_ROOT=You can use DOL_DATA_ROOT/dolibarr.log for a log file in Dolibarr "documents" directory. You can set a different path to store this file. ErrorUnknownSyslogConstant=Constant %s is not a known Syslog constant OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=Cài đặt module Tài trợ DonationsReceiptModel=Mẫu biên nhận Tài trợ diff --git a/htdocs/langs/zh_CN/admin.lang b/htdocs/langs/zh_CN/admin.lang index 28a388d42d3..f235df47386 100644 --- a/htdocs/langs/zh_CN/admin.lang +++ b/htdocs/langs/zh_CN/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=文件名称和路径 YouCanUseDOL_DATA_ROOT=您可以使用 DOL_DATA_ROOT/dolibarr.log 来表示“documents”目录下的日志文件。您可以设置不同的路径来保存此文件。 ErrorUnknownSyslogConstant=常量 %s 不是已知的 Syslog 常数 OnlyWindowsLOG_USER=Windows 仅支持 LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=捐赠模块设置 DonationsReceiptModel=捐赠收据模板 diff --git a/htdocs/langs/zh_TW/admin.lang b/htdocs/langs/zh_TW/admin.lang index e1705410fdd..27eea2ef5c6 100644 --- a/htdocs/langs/zh_TW/admin.lang +++ b/htdocs/langs/zh_TW/admin.lang @@ -1311,8 +1311,6 @@ SyslogFilename=文件名稱和路徑 YouCanUseDOL_DATA_ROOT=你可以使用DOL_DATA_ROOT /可在Dolibarr日誌文件dolibarr.log“文件”目錄。你可以設置一個不同的路徑來存儲該文件。 ErrorUnknownSyslogConstant=恆%s不是一個已知的syslog常數 OnlyWindowsLOG_USER=Windows only supports LOG_USER -SyslogSentryDSN=Sentry DSN -SyslogSentryFromProject=DSN from your Sentry project ##### Donations ##### DonationsSetup=捐贈模組設置 DonationsReceiptModel=模板的捐贈收據 diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 906e44fce72..1732e795990 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -986,13 +986,14 @@ function top_httphead() * * @param string $head Optionnal head lines * @param string $title HTML title - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header + * @param int $disablejs Disable js output + * @param int $disablehead Disable head output * @param array $arrayofjs Array of complementary js files * @param array $arrayofcss Array of complementary css files + * @param int $disablejmobile Disable jmobile * @return void */ -function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') +function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disablejmobile=0) { global $user, $conf, $langs, $db; @@ -1065,7 +1066,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; } // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) + if (! $disablejmobile && (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))) { print ''."\n"; } @@ -1237,7 +1238,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; } // jQuery jMobile - if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) + if (! $disablejmobile && (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0))) { // We must force not using ajax because cache of jquery does not load js of other pages. // This also increase seriously speed onto mobile device where complex js code is very slow and memory very low. @@ -1292,16 +1293,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; } - // Raven.js for client-side Sentry logging support - if (array_key_exists('mod_syslog_sentry', $conf->loghandlers)) { - print '' . "\n"; - print '' . "\n"; - print '' . "\n"; - if (! defined('DISABLE_JQUERY')) { - print '' . "\n"; - } - } - // Global js function print ''."\n"; print ''."\n"; @@ -1387,23 +1378,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a print '' . "\n"; - if ($conf->use_javascript_ajax) - { - // Raven.js for client-side Sentry logging support - if (array_key_exists('mod_syslog_sentry', $conf->loghandlers) && ! empty($conf->global->SYSLOG_SENTRY_DSN)) - { - // Filter out secret key - $dsn = parse_url($conf->global->SYSLOG_SENTRY_DSN); - $public_dsn = $dsn['scheme'] . '://' . $dsn['user'] .'@' . $dsn['host'] . $dsn['path']; - - print '\n"; - } - } - /* * Top menu */ @@ -1841,20 +1815,24 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput $ret=''; $ret.='
    '; - $ret.=''; + if (empty($conf->global->MAIN_HTML5_PLACEHOLDER)) + { + $ret.=''; + } $ret.=''; $ret.=''; $ret.=''; $ret.='global->MAIN_HTML5_PLACEHOLDER)) $ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; $ret.=($accesskey?' accesskey="'.$accesskey.'"':''); if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.strip_tags($title).'"'; // Will work only if MAIN_HTML5_PLACEHOLDER is set to 1 else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; @@ -1940,7 +1918,7 @@ if (! function_exists("llxFooter")) //console.log($(this).parent().parent().find(\'dd ul\')); $(this).parent().parent().find(\'dd ul\').slideToggle(\'fast\'); // Note: Did not find a way to get exact height (value is update at exit) so i calculate a generic from nb of lines - heigthofcontent = 19 * $(this).parent().parent().find(\'dd div ul li\').length; + heigthofcontent = 21 * $(this).parent().parent().find(\'dd div ul li\').length; if (heigthofcontent > 300) heigthofcontent = 300; // limited by max-height on css .dropdown dd ul posbottom = $(this).parent().parent().find(\'dd\').offset().top + heigthofcontent + 8; //console.log(posbottom); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 35bd8e85155..f6d94fb8135 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -69,11 +69,21 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref); - $helpurl=''; - if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; - if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + $title = $langs->trans('ProductServiceCard'); + $helpurl = ''; + $shortlabel = dol_trunc($object->label,16); + if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) + { + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) + { + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } - llxHeader("", $langs->trans("CardProduct".$object->type), $help_url); + llxHeader('', $title, $helpurl); /* * En mode visu diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index b1c69268325..26cf85cb3d6 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -188,10 +188,11 @@ if ($object->fk_user_creat) $userstatic->fetch($object->fk_user_creat); } - +$title = $object->titre." - ".$langs->trans('Card'); +$helpurl = ''; $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); -llxHeader('',$object->titre, 0, 0, 0, 0, $arrayofjs, $arrayofcss); +llxHeader('',$title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss); // Define format of choices @@ -219,7 +220,7 @@ print ''; $linkback = ''.$langs->trans("BackToList").''; // Ref -print ''; +print ''; print ''; diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 93ccd93729b..23ccbc6c8a5 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -49,7 +49,7 @@ $nblignes=$object->fetch_lines(); * Actions */ -//Return to the results +// Return to the results if (GETPOST('retoursondage')) { header('Location: results.php?id='.$_GET['id']); exit; @@ -403,9 +403,11 @@ if ($result <= 0) exit; } +$title = $object->titre." - ".$langs->trans('Card'); +$helpurl = ''; $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); -llxHeader('',$object->titre, 0, 0, 0, 0, $arrayofjs, $arrayofcss); +llxHeader('',$title, $helpurl, 0, 0, 0, $arrayofjs, $arrayofcss); // Define format of choices @@ -432,7 +434,7 @@ print '
    '.$langs->trans('Ref').'
    '.$langs->trans('Ref').''; print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage'); print '
    '; $linkback = ''.$langs->trans("BackToList").''; // Ref -print ''; +print ''; print ''; diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index c9ba1324a70..94ec2a7c247 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * * 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 @@ -133,15 +133,15 @@ llxHeader('', $langs->trans("OpenSurvey"), '', "", 0, 0, $arrayofjs, $arrayofcss print load_fiche_titre($langs->trans("CreatePoll").' (1 / 2)'); -//debut du formulaire +// debut du formulaire print ''."\n"; dol_fiche_head(); -//Affichage des différents champs textes a remplir +// Affichage des différents champs textes a remplir print '
    '.$langs->trans('Ref').'
    '.$langs->trans('Ref').''; print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage'); print '
    '."\n"; -print ''."\n"; +print ''."\n"; if (! $_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre'))) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors'); @@ -180,7 +180,7 @@ if ($_SESSION['allow_comments']) $allow_comments = 'checked'; if (isset($_POST['allow_comments'])) $allow_comments=GETPOST('allow_comments')?'checked':''; print ' '.$langs->trans('CanComment').'
    '."\n"; -if ($_SESSION['allow_spy']) $allow_spy = 'checed'; +if ($_SESSION['allow_spy']) $allow_spy = 'checked'; if (isset($_POST['allow_spy'])) $allow_spy=GETPOST('allow_spy')?'checked':''; print ' '.$langs->trans('CanSeeOthersVote').'
    '."\n"; @@ -193,7 +193,7 @@ if (GETPOST('choix_sondage')) } else { - //affichage des boutons pour choisir sondage date ou autre + // affichage des boutons pour choisir sondage date ou autre print '
    '. $langs->trans("PollTitle") .'
    '. $langs->trans("PollTitle") .'
    '."\n"; print ' '."\n"; print ''."\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5d72f67a0eb..ca52892f518 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -817,12 +817,19 @@ if (empty($reshook)) * View */ -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; - -if (isset($_GET['type'])) $title = $langs->trans('CardProduct'.GETPOST('type')); -else $title = $langs->trans('ProductServiceCard'); +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Card'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Card'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} llxHeader('', $title, $helpurl); @@ -955,7 +962,7 @@ else print ''; } @@ -969,7 +976,7 @@ else // Public URL print ''; // Stock min level @@ -1154,7 +1161,11 @@ else dol_fiche_end(); - print '
    '; + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; print ''; } @@ -1257,7 +1268,7 @@ else print ''; } @@ -1273,7 +1284,7 @@ else // Public Url print ''; // Stock @@ -1364,7 +1375,7 @@ else print ''; // Origin country print ''; } @@ -1515,8 +1526,9 @@ else print ''; print ''; print ''; - print ''; + print ''; print ' '; + print ''; } else { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f4cf2c994a6..962172c3aa6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -926,7 +926,7 @@ class Product extends CommonObject // Delete all child tables if (! $error) { - $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price'); + $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price','product_lot'); foreach($elements as $table) { if (! $error) @@ -3175,7 +3175,7 @@ class Product extends CommonObject if ($reshook > 0) $linkclose = $hookmanager->resPrint; - if ($option == 'supplier') { + if ($option == 'supplier' || $option == 'category') { $link = ''; - } else if ($option == 'category') { - $link = ''; @@ -3727,11 +3725,11 @@ class Product extends CommonObject if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) { $return.= ''; - $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">'; + $return.= ''; } else { $return.= ''; - $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">'; + $return.= ''; } if (empty($nolink)) $return.= ''; diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a65adb1c4b3..ef9c34f32ee 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -133,10 +133,6 @@ else if($action==='save_composed_product') * View */ -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; - $product_fourn = new ProductFournisseur($db); $productstatic = new Product($db); $form = new Form($db); @@ -177,10 +173,22 @@ if ($action == 'search') $resql = $db->query($sql); } -//print $sql; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('AssociatedProducts'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} -llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl); +llxHeader('', $title, $helpurl); $head=product_prepare_head($object); $titre=$langs->trans("CardProduct".$object->type); diff --git a/htdocs/product/document.php b/htdocs/product/document.php index cddcff12374..05d25b4085a 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -166,11 +166,21 @@ if ($action=='filemerge') $form = new Form($db); -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Documents'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Documents'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} -llxHeader("", $langs->trans("CardProduct".$object->type), $help_url); +llxHeader('', $title, $helpurl); if ($object->id) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 3eb08370aba..05d70e7eb26 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -274,19 +274,26 @@ if (empty($reshook)) * view */ -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('BuyingPrices'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('BuyingPrices'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} + +llxHeader('', $title, $helpurl); $form = new Form($db); if ($id > 0 || $ref) { - if ($action <> 're-edit') - { - llxHeader("", $langs->trans("CardProduct".$object->type), $helpurl); - } - if ($result) { if ($action == 'ask_remove_pf') { @@ -365,7 +372,7 @@ if ($id > 0 || $ref) print '
    '. $langs->trans("CreateSurveyDate") .'
    '.$langs->trans("BarcodeValue").''; $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); - print ''; + print ''; print '
    '.$langs->trans("PublicUrl").''; - print ''; + print ''; print '
    '.$langs->trans("BarcodeValue").''; $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); - print ''; + print ''; print '
    '.$langs->trans("PublicUrl").''; - print ''; + print ''; print '
    '.$langs->trans("CustomCode").''.$langs->trans("CountryOrigin").''; - print $form->select_country($object->country_id,'country_id'); + print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); print '
    '; // Supplier - print ''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/product/info.php b/htdocs/product/info.php index 71f1908e434..e29d1a168cb 100644 --- a/htdocs/product/info.php +++ b/htdocs/product/info.php @@ -56,16 +56,24 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e * View */ -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Info'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Info'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} -$title=$langs->trans("Product"); +llxHeader('', $title, $helpurl); $form=new Form($b); -llxHeader('', $title, $help_url); - if ($id > 0 || $ref) { $result = $object->fetch($id,$ref); diff --git a/htdocs/product/note.php b/htdocs/product/note.php index ef53946460f..39f461a4a0e 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -30,17 +30,20 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -$action = GETPOST('action'); - $langs->load("companies"); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action'); + // Security check -$id = GETPOST('id')?GETPOST('id','int'):GETPOST('socid','int'); -if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe', $id, '&societe'); +$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); +$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); +if ($user->societe_id) $socid=$user->societe_id; +$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype); $object = new Product($db); -if ($id > 0) $object->fetch($id); +if ($id > 0 || ! empty($ref)) $object->fetch($id, $ref); $permissionnote=$user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php @@ -64,7 +67,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ThirdParty").' - '.$langs->trans("Notes"), $help_url); -if ($id > 0) +if ($id > 0 || ! empty($ref)) { /* * Affichage onglets @@ -81,13 +84,14 @@ if ($id > 0) print ''; print ''; - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref'); print '
    '; print '
    '; - //$colwidth='25'; - $cssclass='titlefield'; + $cssclass='titlefield'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index c645d76062e..881fa0b95f8 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -10,6 +10,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -92,10 +93,18 @@ if (empty($reshook)) $search_soc = ''; } + if ($action == 'setlabelsellingprice' && $user->admin) + { + require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; + $keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.GETPOST('pricelevel'); + dolibarr_set_const($db, $keyforlabel, GETPOST('labelsellingprice','alpha'), 'chaine', 0, '', $conf->entity); + $action = ''; + } + if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer)) { $tva_tx_txt = GETPOST('tva_tx', 'alpha'); // tva_tx can be '8.5' or '8.5*' or '8.5 (XXX)' or '8.5* (XXX)' - + // We must define tva_tx, npr and local taxes $vatratecode = ''; $tva_tx = preg_replace('/[^0-9\.].*$/', '', $tva_tx_txt); // keep remove all after the numbers and dot @@ -619,11 +628,21 @@ if (! empty($id) || ! empty($ref)) $object->fetch($id, $ref); } -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('SellingPrices'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('SellingPrices'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} -llxHeader("", $langs->trans("CardProduct" . $object->type), $hepl_url); +llxHeader('', $title, $helpurl); $head = product_prepare_head($object); $titre = $langs->trans("CardProduct" . $object->type); @@ -651,7 +670,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) $soc->fetch($socid); // Selling price - print '
    '; + print ''; print ''; } - print ''; + print ''; for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { print ''; // Label of price - print ''; if ($object->multiprices_base_type [$i] == 'TTC') { diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index c8b952a32b1..ebb28b48287 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -95,7 +95,22 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') else { $result = $object->fetch($id,$ref); - llxHeader("",$langs->trans("CardProduct".$object->type)); + + $title = $langs->trans('ProductServiceCard'); + $helpurl = ''; + $shortlabel = dol_trunc($object->label,16); + if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) + { + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Statistics'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) + { + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Statistics'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } + + llxHeader('', $title, $helpurl); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 6f3f8546454..e9eb3d41859 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -90,7 +90,21 @@ if ($id > 0 || ! empty($ref)) $reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - llxHeader("","",$langs->trans("CardProduct".$product->type)); + $title = $langs->trans('ProductServiceCard'); + $helpurl = ''; + $shortlabel = dol_trunc($object->label,16); + if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) + { + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Referers'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) + { + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Referers'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } + + llxHeader('', $title, $helpurl); if ($result > 0) { diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 9dcb51fe8ef..d9381af9b5e 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -234,7 +234,11 @@ if ($action == 'create') dol_fiche_end(); - print '
    '; + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; print ''; } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 0d82d56243a..0a72a7ffca7 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -149,7 +149,6 @@ class MouvementStock extends CommonObject { if ($eatby) { - $eatbywithouthour=$eatby; $tmparray=dol_getdate($eatby, true); $eatbywithouthour=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility @@ -187,9 +186,8 @@ class MouvementStock extends CommonObject { if ($sellby) { - $sellbywithouthour=$sellby; - $tmparray=dol_getdate($eatby, true); - $eatbywithouthour=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); + $tmparray=dol_getdate($sellby, true); + $sellbywithouthour=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) // We test date without hours and with hours for backward compatibility { // If found and eatby/sellby defined into table and provided and differs, return error @@ -442,8 +440,8 @@ class MouvementStock extends CommonObject // $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty; // $sql.= " WHERE rowid = ".$fk_product; // Update pmp + denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql - $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET p.pmp = ".$newpmp.", "; - $sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; + $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".$newpmp.", "; + $sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)"; $sql.= " WHERE rowid = ".$fk_product; dol_syslog(get_class($this)."::_create", LOG_DEBUG); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index fc16dddda0f..2411dde51e4 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -409,8 +409,21 @@ if ($id > 0 || $ref) $object->load_stock(); - $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; - llxHeader("",$langs->trans("CardProduct".$object->type),$help_url); + $title = $langs->trans('ProductServiceCard'); + $helpurl = ''; + $shortlabel = dol_trunc($object->label,16); + if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) + { + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Stock'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + } + if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) + { + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Stock'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + } + + llxHeader('', $title, $helpurl); if ($result > 0) { diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 5ff7dfff7ae..15174f82fb4 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -163,11 +163,21 @@ $result = $object->fetch($id,$ref); * View */ -$helpurl=''; -if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; -if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +$title = $langs->trans('ProductServiceCard'); +$helpurl = ''; +$shortlabel = dol_trunc($object->label,16); +if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) +{ + $title = $langs->trans('Product')." ". $shortlabel ." - ".$langs->trans('Translation'); + $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; +} +if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) +{ + $title = $langs->trans('Service')." ". $shortlabel ." - ".$langs->trans('Translation'); + $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; +} -llxHeader("", $langs->trans("Translation"), $help_url); +llxHeader('', $title, $helpurl); $form = new Form($db); $formadmin=new FormAdmin($db); diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index b9c8e455751..adf6efbc95c 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -90,7 +90,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index fa89e06f398..ce39fad4a14 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->load("projects"); $langs->load('companies'); @@ -170,6 +171,17 @@ if (empty($reshook)) setEventMessages($langs->trans($object->error), null, 'errors'); $error++; } + if (! $error && !empty($object->id) > 0) + { + // Category association + $categories = GETPOST('categories'); + $result=$object->setCategories($categories); + if ($result<0) { + $langs->load("errors"); + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } if (! $error) { @@ -235,7 +247,7 @@ if (empty($reshook)) if (isset($_POST['budget_amount'])) $object->budget_amount= price2num(GETPOST('budget_amount')); if (isset($_POST['opp_status'])) $object->opp_status = $opp_status; if (isset($_POST['opp_percent'])) $object->opp_percent = $opp_percent; - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); if ($ret < 0) $error++; @@ -246,7 +258,7 @@ if (empty($reshook)) $error++; setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); } - + if (! $error) { $result=$object->update($user); @@ -254,6 +266,15 @@ if (empty($reshook)) { $error++; setEventMessages($object->error, $object->errors,'errors'); + }else { + // Category association + $categories = GETPOST('categories'); + $result=$object->setCategories($categories); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } } } @@ -310,7 +331,7 @@ if (empty($reshook)) if ($object->id > 0) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - + $langs->load("other"); $upload_dir = $conf->projet->dir_output; $file = $upload_dir . '/' . GETPOST('file'); @@ -377,7 +398,7 @@ if (empty($reshook)) $clone_notes=GETPOST('clone_notes')?1:0; $move_date=GETPOST('move_date')?1:0; $clone_thirdparty=GETPOST('socid','int')?GETPOST('socid','int'):0; - + $result=$object->createFromClone($object->id,$clone_contacts,$clone_tasks,$clone_project_files,$clone_task_files,$clone_notes,$move_date,0,$clone_thirdparty); if ($result <= 0) { @@ -486,7 +507,7 @@ if ($action == 'create' && $user->rights->projet->creer) print ' '.$langs->trans("AddThirdParty").''; print ''; } - + // Status if ($status != '') { @@ -498,7 +519,9 @@ if ($action == 'create' && $user->rights->projet->creer) // Public print ''; @@ -526,7 +549,7 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; print ''; print ''; - + // Opportunity amount print ''; print ''; @@ -544,6 +567,14 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; print ''; + if($conf->categorie->enabled) { + // Categories + print '"; + } + // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -566,13 +597,13 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; print ''; - + // Change probability from status print ''; - } - + } + /* * Boutons actions */ @@ -895,7 +949,7 @@ else print ''; } } - + // Validate if ($object->statut == 0 && $user->rights->projet->creer) { @@ -908,7 +962,7 @@ else print ''; } } - + // Close if ($object->statut == 1 && $user->rights->projet->creer) { @@ -921,7 +975,7 @@ else print ''; } } - + // Reopen if ($object->statut == 2 && $user->rights->projet->creer) { @@ -934,8 +988,8 @@ else print ''; } } - - // Add button to create objects from project + + // Add button to create objects from project if (! empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) { if (! empty($conf->propal->enabled) && $user->rights->propal->creer) @@ -989,7 +1043,7 @@ else print ''; } } - + // Clone if ($user->rights->projet->creer) { @@ -1002,7 +1056,7 @@ else print ''; } } - + // Delete if ($user->rights->projet->supprimer || ($object->statut == 0 && $user->rights->projet->creer)) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index d5765f102d5..0e7333708f1 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -54,10 +54,10 @@ class Project extends CommonObject var $date_start; var $date_end; var $date_close; - + var $socid; // To store id of thirdparty var $thirdparty_name; // To store name of thirdparty (defined only in some cases) - + var $user_author_id; //!< Id of project creator. Not defined if shared project. var $user_close_id; var $public; //!< Tell if this is a public or private project @@ -234,7 +234,7 @@ class Project extends CommonObject global $langs, $conf; $error=0; - + // Clean parameters $this->title = trim($this->title); $this->description = trim($this->description); @@ -463,9 +463,9 @@ class Project extends CommonObject function get_element_list($type, $tablename, $datefieldname='', $dates='', $datee='') { $elements = array(); - + if ($this->id <= 0) return $elements; - + if ($type == 'agenda') { $sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project=" . $this->id; @@ -905,7 +905,7 @@ class Project extends CommonObject if ($moreinpopup) $label.='
    '.$moreinpopup; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; - if ($option != 'nolink') + if ($option != 'nolink') { if (preg_match('/\.php$/',$option)) { $link = 'societe_id; - + $projectsListId = $this->getProjectsAuthorizedForUser($user,$mine?$mine:($user->rights->projet->all->lire?2:0),1,$socid); - + $sql = "SELECT p.rowid, p.fk_statut as status, p.fk_opp_status, p.datee as datee"; $sql.= " FROM (".MAIN_DB_PREFIX."projet as p"; $sql.= ")"; @@ -1626,33 +1626,33 @@ class Project extends CommonObject //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; - + $resql=$this->db->query($sql); if ($resql) { $project_static = new Project($this->db); - + $response = new WorkboardResponse(); $response->warning_delay = $conf->projet->warning_delay/60/60/24; $response->label = $langs->trans("OpenedProjects"); if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project'; else $response->url = DOL_URL_ROOT.'/projet/list.php?mode=mine&search_status=1&mainmenu=project'; $response->img = img_object($langs->trans("Projects"),"project"); - + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $response->nbtodo++; - + $project_static->statut = $obj->status; $project_static->opp_status = $obj->opp_status; $project_static->datee = $this->db->jdate($obj->datee); - + if ($project_static->hasDelay()) { $response->nbtodolate++; } } - + return $response; } else @@ -1661,8 +1661,8 @@ class Project extends CommonObject return -1; } } - - + + /** * Function used to replace a thirdparty id with another one. * @@ -1679,8 +1679,8 @@ class Project extends CommonObject return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } - - + + /** * Charge indicateurs this->nb pour le tableau de bord * @@ -1689,16 +1689,16 @@ class Project extends CommonObject function load_state_board() { global $conf; - + $this->nb=array(); - + $sql = "SELECT count(u.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as u"; $sql.= " WHERE"; //$sql.= " WHERE u.fk_statut > 0"; //$sql.= " AND employee != 0"; $sql.= " u.entity IN (".getEntity('projet', 1).")"; - + $resql=$this->db->query($sql); if ($resql) { @@ -1716,8 +1716,8 @@ class Project extends CommonObject return -1; } } - - + + /** * Is the project delayed? * @@ -1726,16 +1726,16 @@ class Project extends CommonObject public function hasDelay() { global $conf; - + if (! ($this->statut == 1)) return false; if (! $this->datee) return false; $now = dol_now(); return $this->datee < ($now - $conf->projet->warning_delay); - } + } + - /** * Charge les informations d'ordre info dans l'objet commande * @@ -1762,27 +1762,87 @@ class Project extends CommonObject $cuser->fetch($obj->fk_user_author); $this->user_creation = $cuser; } - + if ($obj->fk_user_cloture) { $cluser = new User($this->db); $cluser->fetch($obj->fk_user_cloture); $this->user_cloture = $cluser; } - + $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); $this->date_cloture = $this->db->jdate($obj->datecloture); } - + $this->db->free($result); - + } else { dol_print_error($this->db); } } - + + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + */ + public function setCategories($categories) + { + // Decode type + $type_id = Categorie::TYPE_PROJECT; + $type_text = 'project'; + + + // Handle single category + if (!is_array($categories)) { + $categories = array($categories); + } + + // Get current categories + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $c = new Categorie($this->db); + $existing = $c->containing($this->id, $type_id, 'id'); + + // Diff + if (is_array($existing)) { + $to_del = array_diff($existing, $categories); + $to_add = array_diff($categories, $existing); + } else { + $to_del = array(); // Nothing to delete + $to_add = $categories; + } + + // Process + foreach ($to_del as $del) { + if ($c->fetch($del) > 0) { + $result=$c->del_type($this, $type_text); + if ($result<0) { + $this->errors=$c->errors; + $this->error=$c->error; + return -1; + } + } + } + foreach ($to_add as $add) { + if ($c->fetch($add) > 0) { + $result=$c->add_type($this, $type_text); + if ($result<0) { + $this->errors=$c->errors; + $this->error=$c->error; + return -1; + } + } + } + + return 1; + } + } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index e8a5ee57386..ea731b5c617 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -37,6 +37,7 @@ if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/ if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; @@ -166,7 +167,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print ''; - + // Opportunity Amount print '
    '.$langs->trans("Supplier").''; + print '
    '.$langs->trans("Supplier").''; if ($rowid) { $supplier=new Fournisseur($db); diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 2d6e0ace9c9..74a974804ff 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -97,7 +97,7 @@ if (count($listofsearchfields)) { if ($i == 0) print '
    '.$langs->trans("Search").'
    :
    ' . $langs->trans("SellingPrice") . '
    '; + print $langs->trans("SellingPrice"); + print ''; if ($object->multiprices_base_type[$soc->price_level] == 'TTC') { print price($object->multiprices_ttc[$soc->price_level]); @@ -712,16 +733,34 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print '
    '.$langs->trans("PriceLevel").''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").'
    '; + print $langs->trans("PriceLevel"); + if ($user->admin) print ' id.'">'.img_edit($langs->trans('EditSellingPriceLabel'),0).''; + print ''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").'
    ' . $langs->trans("SellingPrice") . ' ' . $i; + print ''; $keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i; - if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + if (preg_match('/editlabelsellingprice/', $action)) + { + print ''; + print ''; + print ''; + print ''; + print $langs->trans("SellingPrice") . ' ' . $i.' - '; + print ''; + print ' '; + print ''; + } + else + { + print $langs->trans("SellingPrice") . ' ' . $i; + if (! empty($conf->global->$keyforlabel)) print ' - '.$langs->trans($conf->global->$keyforlabel); + } print '
    '.$langs->trans("Search").'
    :
    '.$langs->trans("Visibility").''; - $array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject")); + $array=array(); + if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject"); + if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject"); print $form->selectarray('public',$array,GETPOST('public')?GETPOST('public'):(isset($conf->global->PROJECT_DEFAULT_PUBLIC)?$conf->global->PROJECT_DEFAULT_PUBLIC:$object->public)); print '
    '.$langs->trans("OpportunityAmount").'
    '.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); + print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); + print "
    '.$langs->trans("OpportunityAmount").''; if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); @@ -194,7 +195,7 @@ $listofreferent=array( 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/comm/propal/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, @@ -234,11 +235,11 @@ $listofreferent=array( 'testnew'=>$user->rights->facture->creer, 'test'=>$conf->facture->enabled && $user->rights->facture->lire), 'proposal_supplier'=>array( - 'name'=>"SuppliersOrders", - 'title'=>"ListSupplierOrdersAssociatedProject", - 'class'=>'CommandeFournisseur', - 'table'=>'commande_fournisseur', - 'datefieldname'=>'date_commande', + 'name'=>"SuppliersProposals", + 'title'=>"ListSupplierProposalsAssociatedProject", + 'class'=>'SupplierProposal', + 'table'=>'supplier_proposal', + 'datefieldname'=>'date', 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', @@ -285,7 +286,7 @@ $listofreferent=array( 'table'=>'fichinter', 'datefieldname'=>'date_valid', 'disableamount'=>1, - 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/fichinter/card.php?action=create&origin=project&originid='.$id.'&socid='.$socid, 'lang'=>'interventions', 'buttonnew'=>'AddIntervention', 'testnew'=>$user->rights->ficheinter->creer, @@ -366,19 +367,19 @@ if ($action=="addelement") $tablename = GETPOST("tablename"); $elementselectid = GETPOST("elementselect"); $result=$object->update_element($tablename, $elementselectid); - if ($result<0) + if ($result<0) { setEventMessages($object->error, $object->errors, 'errors'); } } -elseif ($action == "unlink") +elseif ($action == "unlink") { $tablename = GETPOST("tablename"); $elementselectid = GETPOST("elementselect"); $result = $object->remove_element($tablename, $elementselectid); - if ($result < 0) + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -409,7 +410,7 @@ if (! $showdatefilter) print '
    '; print ''; print '
    '; - + $showdatefilter++; } @@ -580,14 +581,14 @@ foreach ($listofreferent as $key => $value) $urlnew=$value['urlnew']; $buttonnew=$value['buttonnew']; $testnew=$value['testnew']; - + if ($qualified) { // If we want the project task array to have details of users //if ($key == 'project_task') $key = 'project_task_time'; - + if ($langtoload) $langs->load($langtoload); - + $element = new $classname($db); $addform=''; @@ -595,7 +596,7 @@ foreach ($listofreferent as $key => $value) $idtofilterthirdparty=0; if (! in_array($tablename, array('facture_fourn', 'commande_fournisseur'))) $idtofilterthirdparty=$object->thirdparty->id; - if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty > 0) + if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty > 0) { $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300'); if (! $selectList || ($selectList<0)) @@ -626,7 +627,7 @@ foreach ($listofreferent as $key => $value) else $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; $addform.='
    '; } - + print load_fiche_titre($langs->trans($title), $addform, ''); print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 1b0dec4d9f8..752e3615464 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -114,7 +114,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index f3f58c17119..6689f966c15 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -194,7 +194,7 @@ if ($id > 0 || ! empty($ref)) print '
    '.$langs->trans("Search").'
    :
    '; // Ref - print '
    '; + print '
    '; print $langs->trans("Ref"); print ''; // Define a complementary filter for search of next/prev ref. @@ -255,7 +255,7 @@ if ($id > 0 || ! empty($ref)) $linkback=GETPOST('withproject')?''.$langs->trans("BackToList").'':''; // Ref - print '
    '.$langs->trans('Ref').''; + print '
    '.$langs->trans('Ref').''; if (! GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 07fda131407..c9a69fc81a4 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -137,7 +137,7 @@ if ($object->id > 0) print ''; // Ref - print '
    '; + print '
    '; print $langs->trans("Ref"); print ''; // Define a complementary filter for search of next/prev ref. @@ -198,7 +198,7 @@ if ($object->id > 0) print ''; // Ref - print '
    '; + print '
    '; print $langs->trans("Ref"); print ''; if (empty($withproject) || empty($projectstatic->id)) diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index e62e58df58b..5d5cb38dbe5 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -117,7 +117,7 @@ if ($object->id > 0) print ''; // Ref - print ''; - print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''."\n"; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 6e0dcbec113..333ee590f2d 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -79,7 +79,7 @@ if (count($listofsearchfields)) { if ($i == 0) print ''; print ''; - print ''; + print ''; if ($i == 0) print ''; print ''; $i++; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index e4e67ba7eab..af840283223 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -159,7 +159,8 @@ $arrayfields=array( 's.idprof4'=>array('label'=>$langs->trans("ProfId4Short"), 'checked'=>$checkedprofid4), 's.idprof5'=>array('label'=>$langs->trans("ProfId5Short"), 'checked'=>$checkedprofid5), 's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6), - 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), + 'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1), + 's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel), 's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm), 's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -567,6 +568,8 @@ if (! empty($moreforfilter)) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +if (empty($arrayfields['customerorsupplier']['checked'])) print ''; + print '
    '; + print '
    '; print $langs->trans("Ref"); print ''; // Define a complementary filter for search of next/prev ref. @@ -172,7 +172,7 @@ if ($object->id > 0) $linkback=GETPOST('withproject')?''.$langs->trans("BackToList").'':''; // Ref - print '
    '.$langs->trans("Ref").''; + print '
    '.$langs->trans("Ref").''; if (empty($withproject) || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 8eacca6f09e..0caf1461e88 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * @@ -34,25 +34,80 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load('projects'); $id=GETPOST('id','int'); +$projectid=GETPOST('projectid','int'); $ref=GETPOST('ref','alpha'); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $withproject=GETPOST('withproject','int'); $project_ref=GETPOST('project_ref','alpha'); +$search_dateday=GETPOST('search_dateday'); +$search_datemonth=GETPOST('search_datemonth'); +$search_dateyear=GETPOST('search_dateyear'); +$search_datehour=''; +$search_datewithhour=''; +$search_note=GETPOST('search_note','alpha'); +$search_duration=GETPOST('search_duration','int'); +$search_value=GETPOST('search_value','int'); + // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; if (!$user->rights->projet->lire) accessforbidden(); +$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='t.task_date,t.task_datehour,t.rowid'; +if (! $sortorder) $sortorder='DESC'; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('projecttaskcard','globalcard')); + $object = new Task($db); $projectstatic = new Project($db); +$extrafields_project = new ExtraFields($db); +$extrafields_task = new ExtraFields($db); + +if ($projectid > 0 || ! empty($ref)) +{ + // fetch optionals attributes and labels + $extralabels_projet=$extrafields_project->fetch_name_optionals_label($projectstatic->table_element); +} +$extralabels_task=$extrafields_task->fetch_name_optionals_label($object->table_element); /* * Actions */ +$parameters=array('socid'=>$socid, 'projectid'=>$projectid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers +{ + $search_date=''; + $search_datehour=''; + $search_datewithhour=''; + $search_note=''; + $search_duration=''; + $search_value=''; + $search_date_creation=''; + $search_date_update=''; + $toselect=''; + $search_array_options=array(); + $action=''; +} + if ($action == 'addtimespent' && $user->rights->projet->lire) { $error=0; @@ -202,7 +257,6 @@ if (GETPOST('projectid')) } - /* * View @@ -223,12 +277,14 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) { $result=$projectstatic->fetch($projectidforalltimes); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); + $res=$projectstatic->fetch_optionals($object->id,$extralabels_projet); } elseif ($object->fetch($id, $ref) >= 0) { $result=$projectstatic->fetch($object->fk_project); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); - + $res=$projectstatic->fetch_optionals($object->id,$extralabels_projet); + $object->project = clone $projectstatic; } @@ -247,7 +303,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; // Ref print ''; - // Budget - print ''; - - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields_project->attribute_label)) + if ((! $id && ! $ref) || ! empty($projectidforalltimes)) // Not a dedicated task { - print $object->showOptionals($extrafields_project); - } - + // Budget + print ''; + + // Other options + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$projectstatic,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields_project->attribute_label)) + { + print $projectstatic->showOptionals($extrafields_project); + } + } + print '
    '; @@ -291,19 +347,22 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print dol_print_date($projectstatic->date_end,'day'); print '
    '.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); - print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) print price($projectstatic->budget_amount,'',$langs,0,0,0,$conf->currency); + print '
    '; dol_fiche_end(); @@ -312,7 +371,8 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) /* * Actions */ - if (empty($id)) + + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) { print '
    '; @@ -353,7 +413,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $linkback=$withproject?''.$langs->trans("BackToList").'':''; // Ref - print '
    '; + print '
    '; print $langs->trans("Ref"); print ''; if (! GETPOST('withproject') || empty($projectstatic->id)) @@ -492,19 +552,51 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if ($projectstatic->id > 0) { + if ($action == 'deleteline') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1); + } + + // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array + $hookmanager->initHooks(array('tasktimelist')); + $extrafields = new ExtraFields($db); + + // Definition of fields for list + $arrayfields=array(); + $arrayfields['t.task_date']=array('label'=>$langs->trans("Date"), 'checked'=>1); + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task + { + $arrayfields['t.task_ref']=array('label'=>$langs->trans("Task"), 'checked'=>1); + } + $arrayfields['author']=array('label'=>$langs->trans("By"), 'checked'=>1); + $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); + $arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1); + $arrayfields['value']=array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>$conf->salaries->enabled); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } + } + /* * List of time spent */ $tasks = array(); - $sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm"; - $sql.= ", u.lastname, u.firstname"; - $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; - $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE t.fk_user = u.rowid"; + $sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,"; + $sql .= " pt.ref, pt.label,"; + $sql .= " u.lastname, u.firstname"; + $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; + $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; if (empty($projectidforalltimes)) $sql .= " AND t.fk_task =".$object->id; - $sql .= " ORDER BY t.task_date DESC, t.task_datehour DESC, t.rowid DESC"; - + else $sql.= " AND pt.fk_projet IN (".$projectidforalltimes.")"; + if ($search_ref) $sql .= natural_search('c.ref', $search_ref); + if ($search_note) $sql .= natural_search('t.note', $search_note); + $sql .= $db->order($sortfield, $sortorder); + $var=true; $resql = $db->query($sql); if ($resql) @@ -534,27 +626,152 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) dol_print_error($db); } - print '
    '; + + $arrayofselected=is_array($toselect)?$toselect:array(); + + $params=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($search_note != '') $params.= '&search_note='.urlencode($search_note); + if ($search_duration != '') $params.= '&search_field2='.urlencode($search_duration); + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + /*foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + }*/ + if ($id) $params.='&id='.$id; + if ($projectid) $params.='&projectid='.$projectid; + if ($withproject) $params.='&withproject='.$withproject; + + + $arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + //if ($user->rights->projet->creer) $arrayofmassactions['delete']=$langs->trans("Delete"); + if ($massaction == 'presend') $arrayofmassactions=array(); + $massactionbutton=$form->selectMassAction('', $arrayofmassactions); + + + + print ''; + if ($optioncss != '') print ''; print ''; - print ''; - print ''; + print ''; + if ($action == 'editline') print ''; + else print ''; + print ''; + print ''; + + print ''; + print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - if (! empty($conf->salaries->enabled)) + $moreforfilter = ''; + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; + + if (! empty($moreforfilter)) { - print ''; + print '
    '; + print $moreforfilter; + print '
    '; } - print ''; + + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
    '.$langs->trans("Date").''.$langs->trans("By").''.$langs->trans("Note").''.$langs->trans("TimeSpent").''.$langs->trans("Value").' 
    '."\n"; + + print ''; + if (! empty($arrayfields['t.task_date']['checked'])) print_liste_field_titre($arrayfields['t.task_date']['label'],$_SERVER['PHP_SELF'],'t.task_date,t.task_datehour,t.rowid','',$params,'',$sortfield,$sortorder); + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task + { + if (! empty($arrayfields['t.task_ref']['checked'])) print_liste_field_titre($arrayfields['t.task_ref']['label'],$_SERVER['PHP_SELF'],'pt.ref','',$params,'',$sortfield,$sortorder); + } + if (! empty($arrayfields['author']['checked'])) print_liste_field_titre($arrayfields['author']['label'],$_SERVER['PHP_SELF'],'','',$params,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.note']['checked'])) print_liste_field_titre($arrayfields['t.note']['label'],$_SERVER['PHP_SELF'],'t.note','',$params,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.task_duration']['checked'])) print_liste_field_titre($arrayfields['t.task_duration']['label'],$_SERVER['PHP_SELF'],'t.task_duration','',$params,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['value']['checked'])) print_liste_field_titre($arrayfields['value']['label'],$_SERVER['PHP_SELF'],'','',$params,'align="right"',$sortfield,$sortorder); + // Extra fields + /* + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + }*/ + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; + // Fields title search + print ''; + // LIST_OF_TD_TITLE_SEARCH + if (! empty($arrayfields['t.task_date']['checked'])) print ''; + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task + { + if (! empty($arrayfields['t.task_ref']['checked'])) print ''; + } + if (! empty($arrayfields['author']['checked'])) print ''; + if (! empty($arrayfields['t.note']['checked'])) print ''; + if (! empty($arrayfields['t.task_duration']['checked'])) print ''; + if (! empty($arrayfields['value']['checked'])) print ''; + // Extra fields + /* + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + $typeofextrafield=$extrafields->attribute_type[$key]; + print ''; + } + } + }*/ + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields); + $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print ''; + print ''."\n"; + + $tasktmp = new Task($db); + + $i = 0; $total = 0; $totalvalue = 0; + $totalarray=array(); foreach ($tasks as $task_time) { $var=!$var; @@ -564,76 +781,119 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $date2=$db->jdate($task_time->task_datehour); // Date - print ''; + if (! $i) $totalarray['nbfield']++; } - else - { - print dol_print_date(($date2?$date2:$date1),($task_time->task_date_withhour?'dayhour':'day')); - } - print ''; + // Task + if (! empty($arrayfields['t.task_ref']['checked'])) + { + if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) // Not a dedicated task + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + } + // User - print ''; + if (! empty($arrayfields['author']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Note - print ''; - + if (! empty($arrayfields['t.note']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } + // Time spent - print ''; - + if (! empty($arrayfields['t.task_duration']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totaldurationfield']=$totalarray['nbfield']; + $totalarray['totalduration'] += $task_time->task_duration; + } + // Value spent - if ($conf->salaries->enabled) - { + if (! empty($arrayfields['value']['checked'])) + { print ''; - } + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalvaluefield']=$totalarray['nbfield']; + $totalarray['totalvalue'] += $value; + } - // Edit and delete icon - print ''; - + print ''; + if (! $i) $totalarray['nbfield']++; + print "\n"; - $total += $task_time->task_duration; - $totalvalue += price2num($task_time->thm * $task_time->task_duration / 3600); + + $i++; } - print ''; - print ''; - if ($conf->salaries->enabled) + + // Show total line + if (isset($totalarray['totaldurationfield']) || isset($totalarray['totalvaluefield'])) { - print ''; + print ''; + $i=0; + while ($i < $totalarray['nbfield']) + { + $i++; + if ($i == 1) + { + if ($num < $limit) print ''; + else print ''; + } + elseif ($totalarray['totaldurationfield'] == $i) print ''; + elseif ($totalarray['totalvaluefield'] == $i) print ''; + else print ''; + } + print ''; } - print ''; + print ''; print "
    '; + if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select'))) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $searchclass=''; + if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring'; + if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum'; + print ''; + } + print ''; + $searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); + print $searchpitco; + print '
    '; - if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) + if (! empty($arrayfields['t.task_date']['checked'])) { - print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); + print ''; + if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) + { + print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); + } + else + { + print dol_print_date(($date2?$date2:$date1),($task_time->task_date_withhour?'dayhour':'day')); + } + print ''; + $tasktmp->id = $task_time->fk_task; + $tasktmp->ref = $task_time->ref; + $tasktmp->label = $task_time->label; + print $tasktmp->getNomUrl(1, 'withproject', 'time'); + print ''; - if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) - { - $contactsoftask=$object->getListContactId('internal'); - if (!in_array($task_time->fk_user,$contactsoftask)) { - $contactsoftask[]=$task_time->fk_user; - } - if (count($contactsoftask)>0) { - print img_object('','user','class="hideonsmartphone"'); - print $form->select_dolusers($task_time->fk_user,'userid_line',0,'',0,'',$contactsoftask); - }else { - print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); - } - } - else - { - $userstatic->id = $task_time->fk_user; - $userstatic->lastname = $task_time->lastname; - $userstatic->firstname = $task_time->firstname; - print $userstatic->getNomUrl(1); - } - print ''; + if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) + { + if (empty($object->id)) $object->fetch($id); + $contactsoftask=$object->getListContactId('internal'); + if (!in_array($task_time->fk_user,$contactsoftask)) { + $contactsoftask[]=$task_time->fk_user; + } + if (count($contactsoftask)>0) { + print img_object('','user','class="hideonsmartphone"'); + print $form->select_dolusers($task_time->fk_user,'userid_line',0,'',0,'',$contactsoftask); + }else { + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); + } + } + else + { + $userstatic->id = $task_time->fk_user; + $userstatic->lastname = $task_time->lastname; + $userstatic->firstname = $task_time->firstname; + print $userstatic->getNomUrl(1); + } + print ''; - if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) - { - print ''; - } - else - { - print dol_nl2br($task_time->note); - } - print ''; + if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) + { + print ''; + } + else + { + print dol_nl2br($task_time->note); + } + print ''; - if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) - { - print ''; - print $form->select_duration('new_duration',$task_time->task_duration,0,'text'); - } - else - { - print convertSecondToTime($task_time->task_duration,'allhourmin'); - } - print ''; + if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) + { + print ''; + print $form->select_duration('new_duration',$task_time->task_duration,0,'text'); + } + else + { + print convertSecondToTime($task_time->task_duration,'allhourmin'); + } + print ''; - print price(price2num($task_time->thm * $task_time->task_duration / 3600), 1, $langs, 1, -1, -1, $conf->currency); + $value = price2num($task_time->thm * $task_time->task_duration / 3600); + print price($value, 1, $langs, 1, -1, -1, $conf->currency); print ''; + // Fields from hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Action column + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; @@ -653,19 +913,34 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print img_delete(); print ''; } - print '
    '.$langs->trans("Total").''.convertSecondToTime($total,'allhourmin').''.price($totalvalue, 1, $langs, 1, -1, -1, $conf->currency).'
    '.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.convertSecondToTime($totalarray['totalduration'],'allhourmin').''.price($totalarray['totalvalue']).'
     
    "; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 1dd8fc461e0..e50193d8d51 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -90,7 +90,7 @@ if (empty($reshook)) 'mailmanspip','notification','oauth','syslog','user','webservices', // Extended modules 'memcached','numberwords','zipautofillfr'); - $alwayshiddenuncheckedmodules=array('ftp','webservicesclient','websites', + $alwayshiddenuncheckedmodules=array('ftp','hrm','webservicesclient','websites', // Extended modules 'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','customfield','deplacement','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','multicompany','nltechno','numberingpack','openstreetmap', 'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail'); @@ -375,8 +375,11 @@ foreach ($demoprofiles as $profilearray) $listofdisabledmodules=explode(',',$profilearray['disablemodules']); $j=0; $nbcolsmod=empty($conf->dol_optimize_smallscreen)?4:3; - foreach($modules as $val) // Loop on qualified (enabled) modules + //var_dump($modules); + foreach($orders as $index => $key) // Loop on qualified (enabled) modules { + //print $index.' '.$key; + $val = $modules[$index]; $modulekeyname=strtolower($val->name); $modulequalified=1; @@ -454,7 +457,7 @@ if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AD_CLI } else { - print ''."\n"; + print ''."\n"; } } diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 28ff4bdb743..05a291d5c4d 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -82,7 +82,7 @@ else

    This page is a sample of page using tables. It is designed to make test with
    - css (add parameter &theme=newtheme to test another theme or edit css of current theme)
    -- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
    +- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 960 to enable view with jmobile)
    - no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
    - dataTables
    - tablednd
    diff --git a/htdocs/resource/add.php b/htdocs/resource/add.php index 70d1da95969..7608e1b6cf3 100644 --- a/htdocs/resource/add.php +++ b/htdocs/resource/add.php @@ -135,7 +135,7 @@ if (! $action) // Ref / label $field = 'ref'; print '

    '; + print ''; print $langs->trans('ResourceFormLabel_'.$field); print ''; @@ -166,11 +166,11 @@ if (! $action) dol_fiche_end(''); - echo '
    ', - '', - '   ', - '', - '
    '; + print '
    '; + print ''; + print '     '; + print ''; + print '
    '; print ''; } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 0a738846363..633be01aa1b 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -339,7 +339,7 @@ class Dolresource extends CommonObject if ($this->db->query($sql)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql.= " WHERE element_type='resource' AND resource_id ='".$this->db->escape($rowid)."'"; + $sql.= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); dol_syslog(get_class($this)."::delete", LOG_DEBUG); if ($this->db->query($sql)) { @@ -393,7 +393,6 @@ class Dolresource extends CommonObject } } } - $sql.= " GROUP BY t.rowid, t.entity, t.ref, t.description, t.fk_code_type_resource, t.tms, ty.label"; $sql.= $this->db->order($sortfield,$sortorder); $this->num_all = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -410,10 +409,9 @@ class Dolresource extends CommonObject $num = $this->db->num_rows($resql); if ($num) { - $i = 0; - while ($i < $num) + $this->lines=array(); + while ($obj = $this->db->fetch_object($resql)) { - $obj = $this->db->fetch_object($resql); $line = new Dolresource($this->db); $line->id = $obj->rowid; $line->ref = $obj->ref; @@ -421,8 +419,7 @@ class Dolresource extends CommonObject $line->fk_code_type_resource = $obj->fk_code_type_resource; $line->type_label = $obj->type_label; - $this->lines[$i] = $line; - $i++; + $this->lines[] = $line; } $this->db->free($resql); } @@ -473,7 +470,6 @@ class Dolresource extends CommonObject } } } - $sql.= " GROUP BY t.rowid, ty.label"; $sql.= $this->db->order($sortfield,$sortorder); if ($limit) $sql.= $this->db->plimit($limit+1,$offset); dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); @@ -484,10 +480,8 @@ class Dolresource extends CommonObject $num = $this->db->num_rows($resql); if ($num) { - $i = 0; - while ($i < $num) + while ($obj = $this->db->fetch_object($resql)) { - $obj = $this->db->fetch_object($resql); $line = new Dolresource($this->db); $line->id = $obj->rowid; $line->resource_id = $obj->resource_id; @@ -502,9 +496,8 @@ class Dolresource extends CommonObject $line->objresource = fetchObjectByElement($obj->resource_id,$obj->resource_type); if($obj->element_id && $obj->element_type) $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); - $this->lines[$i] = $line; + $this->lines[] = $line; - $i++; } $this->db->free($resql); } @@ -559,7 +552,6 @@ class Dolresource extends CommonObject } } } - $sql.= " GROUP BY t.resource_id"; $sql.= $this->db->order($sortfield,$sortorder); if ($limit) $sql.= $this->db->plimit($limit+1,$offset); dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG); @@ -570,10 +562,9 @@ class Dolresource extends CommonObject $num = $this->db->num_rows($resql); if ($num) { - $i = 0; - while ($i < $num) + $this->lines=array(); + while ($obj = $this->db->fetch_object($resql)) { - $obj = $this->db->fetch_object($resql); $line = new Dolresource($this->db); $line->id = $obj->rowid; $line->resource_id = $obj->resource_id; @@ -584,9 +575,7 @@ class Dolresource extends CommonObject $line->mandatory = $obj->mandatory; $line->fk_user_create = $obj->fk_user_create; - $this->lines[$i] = fetchObjectByElement($obj->resource_id,$obj->resource_type); - - $i++; + $this->lines[] = fetchObjectByElement($obj->resource_id,$obj->resource_type); } $this->db->free($resql); } @@ -759,7 +748,7 @@ class Dolresource extends CommonObject /** * Return an array with resources linked to the element - * + * * @param string $element Element * @param int $element_id Id * @param string $resource_type Type @@ -770,7 +759,7 @@ class Dolresource extends CommonObject // Links beetween objects are stored in this table $sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory'; $sql.= ' FROM '.MAIN_DB_PREFIX.'element_resources'; - $sql.= " WHERE element_id='".$element_id."' AND element_type='".$element."'"; + $sql.= " WHERE element_id=".$element_id." AND element_type='".$this->db->escape($element)."'"; if($resource_type) $sql.=" AND resource_type LIKE '%".$resource_type."%'"; $sql .= ' ORDER BY resource_type'; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 61b3ccae469..9be1124210f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1166,7 +1166,7 @@ class Societe extends CommonObject $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; $this->shipping_method_id = ($obj->fk_shipping_method>0)?$obj->fk_shipping_method:null; $this->fk_account = $obj->fk_account; - + $this->client = $obj->client; $this->fournisseur = $obj->fournisseur; @@ -1431,6 +1431,18 @@ class Societe extends CommonObject } } + // Remove societe_remise + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_remise"; + $sql.= " WHERE fk_soc = " . $id; + if (! $this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } + } + // Remove societe_remise_except if (! $error) { @@ -1542,7 +1554,7 @@ class Societe extends CommonObject */ function set_remise_client($remise, $note, User $user) { - global $langs; + global $conf, $langs; // Nettoyage parametres $note=trim($note); @@ -1574,8 +1586,8 @@ class Societe extends CommonObject // Ecrit trace dans historique des remises $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise"; - $sql.= " (datec, fk_soc, remise_client, note, fk_user_author)"; - $sql.= " VALUES ('".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($remise)."',"; + $sql.= " (entity, datec, fk_soc, remise_client, note, fk_user_author)"; + $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', ".$this->id.", '".$this->db->escape($remise)."',"; $sql.= " '".$this->db->escape($note)."',"; $sql.= " ".$user->id; $sql.= ")"; @@ -1684,7 +1696,7 @@ class Societe extends CommonObject $reparray=array(); - $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.email, u.statut, u.entity"; + $sql = "SELECT DISTINCT u.rowid, u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { @@ -1712,6 +1724,8 @@ class Societe extends CommonObject $reparray[$i]['email']=$obj->email; $reparray[$i]['statut']=$obj->statut; $reparray[$i]['entity']=$obj->entity; + $reparray[$i]['login']=$obj->login; + $reparray[$i]['photo']=$obj->photo; $i++; } return $reparray; @@ -1843,7 +1857,7 @@ class Societe extends CommonObject $label.= '
    '; - if ($option == 'customer' || $option == 'compta') + if ($option == 'customer' || $option == 'compta' || $option == 'category' || $option == 'category_supplier') { $label.= '' . $langs->trans("ShowCustomer") . ''; $link = ''; $link = ''; - $link = ''; - $link = ''; @@ -1922,7 +1926,7 @@ class Societe extends CommonObject } $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; $linkclose.=' class="classfortooltip"'; - + if (! is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; @@ -2760,7 +2764,7 @@ class Societe extends CommonObject $url=''; $action = ''; - + $hookmanager->initHooks(array('idprofurl')); $parameters=array('idprof'=>$idprof, 'company'=>$thirdparty); $reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks @@ -2773,14 +2777,14 @@ class Societe extends CommonObject //if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1; if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; - + if ($url) return ''.$langs->trans("Check").''; } else { return $hookmanager->resPrint; } - + return ''; } @@ -3508,9 +3512,9 @@ class Societe extends CommonObject */ $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; $sql .= ' WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN ( '; - $sql = ' SELECT fk_user '; - $sql = ' FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; - $sql = ' WHERE fk_soc = '.(int) $origin_id.') '; + $sql .= ' SELECT fk_user '; + $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; + $sql .= ' WHERE fk_soc = '.(int) $origin_id.') '; $query = $db->query($sql); diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 08d2bdd7a8b..e0f5ab7ec91 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -137,7 +137,7 @@ if (! empty($socid)) print '
    '.$langs->trans("SalesRepresentatives").''; - $sql = "SELECT DISTINCT u.rowid, u.login, u.fk_soc, u.lastname, u.firstname, u.statut, u.entity"; + $sql = "SELECT DISTINCT u.rowid, u.login, u.fk_soc, u.lastname, u.firstname, u.statut, u.entity, u.photo"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) @@ -184,7 +184,8 @@ if (! empty($socid)) $tmpuser->login = $obj->login; $tmpuser->entity = $obj->entity; $tmpuser->societe_id = $obj->fk_soc; - print $tmpuser->getNomUrl(1); + $tmpuser->photo = $obj->photo; + print $tmpuser->getNomUrl(-1); /*print ''; print img_object($langs->trans("ShowUser"),"user").' '; @@ -227,7 +228,7 @@ if (! empty($socid)) $langs->load("users"); $title=$langs->trans("ListOfUsers"); - $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login, u.email, u.statut, u.fk_soc"; + $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login, u.email, u.statut, u.fk_soc, u.photo"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) { @@ -273,10 +274,11 @@ if (! empty($socid)) $tmpuser->login=$obj->login; $tmpuser->email=$obj->email; $tmpuser->societe_id=$obj->fk_soc; - print $tmpuser->getNomUrl(1); + $tmpuser->photo=$obj->photo; + print $tmpuser->getNomUrl(-1); print ''.$obj->login.''.User::LibStatut($obj->statut,0).''.$tmpuser->getLibStatut(2).''.$langs->trans("Add").'
    '.$langs->trans("Search").'
    :
    '; print ''; @@ -587,7 +590,7 @@ if (! empty($arrayfields['s.ape']['checked'])) print_liste_field_titr if (! empty($arrayfields['s.idprof4']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$param,'class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.idprof5']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId5Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof5","",$param,'class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['s.idprof6']['checked'])) print_liste_field_titre($form->textwithpicto($langs->trans("ProfId6Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof6","",$param,'class="nowrap"',$sortfield,$sortorder); -print_liste_field_titre(''); // type of customer +if (! empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); // Extra fields @@ -735,17 +738,19 @@ if (! empty($arrayfields['s.idprof6']['checked'])) } // Type (customer/prospect/supplier) -print ''; - +if (! empty($arrayfields['customerorsupplier']['checked'])) +{ + print ''; +} if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) { // Prospect level @@ -946,30 +951,33 @@ while ($i < min($num, $limit)) print "\n"; } // Type - print ''; + if (! empty($arrayfields['customerorsupplier']['checked'])) + { + print ''; + } if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) { // Prospect level diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 11c62f7ccfc..39a0ee2371b 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -52,7 +52,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="a.daten"; +if (! $sortfield) $sortfield="n.daten"; $now=dol_now(); @@ -221,9 +221,9 @@ if ($result > 0) // Line with titles print '
    '; -if ($type != '') print ''; -print ''; + if ($type != '') print ''; + print '".$obj->idprof6."'; - $s=''; - if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) - { - $companystatic->name=$langs->trans("Customer"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'customer'); - } - if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) - { - if ($s) $s.=" / "; - $companystatic->name=$langs->trans("Prospect"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'prospect'); - } - if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) - { - if ($s) $s.=" / "; - $companystatic->name=$langs->trans("Supplier"); - $companystatic->name_alias=''; - $s.=$companystatic->getNomUrl(0,'supplier'); - } - print $s; - print ''; + $s=''; + if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) + { + $companystatic->name=$langs->trans("Customer"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'customer'); + } + if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + { + if ($s) $s.=" / "; + $companystatic->name=$langs->trans("Prospect"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'prospect'); + } + if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) + { + if ($s) $s.=" / "; + $companystatic->name=$langs->trans("Supplier"); + $companystatic->name_alias=''; + $s.=$companystatic->getNomUrl(0,'supplier'); + } + print $s; + print '
    '; print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'"width="10%"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -242,11 +242,11 @@ if ($result > 0) $label=($langs->trans("Notify_".$managedeventfornotification['code'])!="Notify_".$managedeventfornotification['code']?$langs->trans("Notify_".$managedeventfornotification['code']):$managedeventfornotification['label']); $actions[$managedeventfornotification['rowid']]=$label; } - print ''; - print ''; print ''; - print ''; - print ''; print ''; // Juridical type - print ''; diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 22d99d3e9c3..fe2add787c4 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -27,10 +27,12 @@ foreach($listsalesrepresentatives as $val) { $userstatic->id=$val['id']; + $userstatic->login=$val['login']; $userstatic->lastname=$val['lastname']; $userstatic->firstname=$val['firstname']; $userstatic->statut=$val['statut']; - print $userstatic->getNomUrl(1); + $userstatic->photo=$val['photo']; + print $userstatic->getNomUrl(-1); $i++; if ($i < $nbofsalesrepresentative) print ', '; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index e53378e0423..30700695b00 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -109,13 +109,13 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { if ($cancel) $action=''; - + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - + // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') { @@ -130,8 +130,8 @@ if (empty($reshook)) if ($result > 0) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result); exit(); - } - else + } + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; @@ -581,7 +581,7 @@ if (empty($reshook)) $tva_tx = get_default_tva($mysoc, $object->thirdparty, $prod->id); $tva_npr = get_default_npr($mysoc, $object->thirdparty, $prod->id); if (empty($tva_tx)) $tva_npr=0; - + //On garde le prix indiqué dans l'input pour la demande de prix fournisseur //$pu_ht = $prod->price; $pu_ht = price2num($price_ht, 'MU'); @@ -776,7 +776,7 @@ if (empty($reshook)) // Add buying price $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); - $buyingprice = (GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value + $buyingprice = (GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we muste keep this value // Extrafields $extrafieldsline = new ExtraFields($db); @@ -947,7 +947,7 @@ if (empty($reshook)) else if ($action == 'setmode' && $user->rights->supplier_proposal->creer) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); } - + // Multicurrency Code else if ($action == 'setmulticurrencycode' && $user->rights->supplier_proposal->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); @@ -955,7 +955,7 @@ if (empty($reshook)) // Multicurrency rate else if ($action == 'setmulticurrencyrate' && $user->rights->supplier_proposal->creer) { - $result = $object->setMulticurrencyRate(GETPOST('multicurrency_tx', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } else if ($action == 'update_extras') { @@ -1142,14 +1142,14 @@ if ($action == 'create') print ''; print ''; } - + // Multicurrency if (! empty($conf->multicurrency->enabled)) { print ''; print ''; print ''; } @@ -1506,7 +1506,7 @@ if ($action == 'create') $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, 'none'); } print ''; - + // Multicurrency rate print ''; print ''; print ''; print ''; - + // Multicurrency Amount VAT print ''; print ''; print ''; - + // Multicurrency Amount TTC print ''; print ''; - print ''; + print ''; } // Statut @@ -1770,7 +1770,7 @@ if ($action == 'create') print ''; } - + // Clone if ($user->rights->supplier_proposal->creer) { print ''; @@ -1883,7 +1883,7 @@ if ($action == 'create') include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'spr'.$object->id); } - + $formmail->withfrom = 1; $liste = array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 00efb287dcc..09fa2dc69e9 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1192,8 +1192,8 @@ class SupplierProposal extends CommonObject $sql = "SELECT d.rowid, d.fk_supplier_proposal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,"; $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,"; $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,'; - $sql.= ' d.ref_fourn as ref_produit_fourn'; - $sql.= ' ,d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; + $sql.= ' d.ref_fourn as ref_produit_fourn,'; + $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; $sql.= " WHERE d.fk_supplier_proposal = ".$this->id; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 512db4b7c4d..c17cf9f8757 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -195,8 +195,8 @@ $companystatic=new Societe($db); $now=dol_now(); -$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,'; -$sql.= ' p.rowid as supplier_proposalid, p.note_private, p.total_ht, p.ref, p.fk_statut, p.fk_user_author, p.date_valid, p.date_livraison as dp,'; +$sql = 'SELECT s.rowid as socid, s.nom as name, s.town, s.client, s.code_client,'; +$sql.= ' p.rowid, p.note_private, p.total_ht, p.ref, p.fk_statut, p.fk_user_author, p.date_valid, p.date_livraison as dp,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'supplier_proposal as p'; @@ -388,10 +388,10 @@ if ($result) print ''; - + // Check boxes print ''; print "\n"; @@ -402,78 +402,93 @@ if ($result) while ($i < min($num,$limit)) { - $objp = $db->fetch_object($result); + $obj = $db->fetch_object($result); $now = dol_now(); $var=!$var; + + $objectstatic->id=$obj->rowid; + $objectstatic->ref=$obj->ref; + print ''; print '\n"; - $url = DOL_URL_ROOT.'/comm/card.php?socid='.$objp->rowid; + $url = DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid; // Company - $companystatic->id=$objp->rowid; - $companystatic->name=$objp->name; - $companystatic->client=$objp->client; - $companystatic->code_client=$objp->code_client; + $companystatic->id=$obj->socid; + $companystatic->name=$obj->name; + $companystatic->client=$obj->client; + $companystatic->code_client=$obj->code_client; print ''; // Date print '\n"; // Date delivery print '\n"; - print '\n"; + print '\n"; - $userstatic->id=$objp->fk_user_author; - $userstatic->login=$objp->login; + $userstatic->id=$obj->fk_user_author; + $userstatic->login=$obj->login; print '\n"; - print '\n"; + print '\n"; - print ''; + // Action column + print ''; print "\n"; - $total += $objp->total_ht; - $subtotal += $objp->total_ht; + $total += $obj->total_ht; + $subtotal += $obj->total_ht; $i++; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3c0b7576c69..43f4ddc70c4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -635,6 +635,7 @@ div.myavailability { @media only screen and (max-width: 960px) { + .maxwidthonsmartphone { max-width: 100px; } .minwidth50imp { min-width: 50px !important; } .minwidth100imp { min-width: 50px !important; } .minwidth200imp { min-width: 100px !important; } @@ -650,6 +651,7 @@ div.myavailability { .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } .maxwidth100onsmartphone { max-width: 100px; } + .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -1867,10 +1869,10 @@ div.tabsElem { div.tabBar { color: #; - padding-top: px; - padding-left: px; - padding-right: px; - padding-bottom: px; + padding-top: 16px; + padding-left: 18px; + padding-right: 18px; + padding-bottom: 14px; margin: 0px 0px 14px 0px; -moz-border-radius:4px; -webkit-border-radius: 4px; @@ -1911,12 +1913,11 @@ div.tabsAction > a { a.tabTitle { color:rgba(0,0,0,.5) !important; - margin-right:10px; text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal !important; - padding: 4px 6px 2px 6px; - margin: 0px 6px; + padding: 4px 6px 2px 0px; + margin-right: 10px; text-decoration: none; white-space: nowrap; } @@ -2829,7 +2830,7 @@ div.tabBar .noborder { margin-bottom: 8px !important;*/ border: 1px solid #CCC; text-align: center; - border-radius: 4px; + border-radius: 2px; } .boxstats:hover { box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20); @@ -3364,9 +3365,6 @@ li.cal_event { border: none; list-style-type: none; } .cal_event_busy { } .cal_peruserviewname { max-width: 100px; height: 22px; } -.topmenuimage { - background-size: 28px auto; -} /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ @@ -3798,9 +3796,9 @@ div.ecmjqft { /* use or not ? */ div.jnotify-background { opacity : 0.95 !important; - -moz-box-shadow: 3px 3px 4px #888 !important; - -webkit-box-shadow: 3px 3px 4px #888 !important; - box-shadow: 3px 3px 4px #888 !important; + -moz-box-shadow: 2px 2px 4px #888 !important; + -webkit-box-shadow: 2px 2px 4px #888 !important; + box-shadow: 2px 2px 4px #888 !important; } /* ============================================================================== */ @@ -4090,13 +4088,17 @@ dl.dropdown { .dropdown dd ul li { white-space: nowrap; font-weight: normal; + padding: 2px; } .dropdown dd ul li input[type="checkbox"] { margin-right: 3px; } -.dropdown dd ul li a { - padding:5px; - display:block; +.dropdown dd ul li a, .dropdown dd ul li span { + padding: 3px; + display: block; +} +.dropdown dd ul li span { + color: #888; } .dropdown dd ul li a:hover { background-color:#fff; @@ -4320,7 +4322,6 @@ border-top-right-radius: 6px; .menu_choix1 a { background: url('') top left no-repeat; } - .menu_choix2 a { background: url('') top left no-repeat; } @@ -4337,12 +4338,34 @@ border-top-right-radius: 6px; padding-top: 18px; padding-left: 54px; font-size: 14px; - height: 40px; + height: 38px; } .menu_choix1 a:hover,.menu_choix2 a:hover { color: #6d3f6d; } - +.menu li.menu_choix1 { + padding-top: 6px; + padding-right: 10px; +} +.menu li.menu_choix2 { + padding-top: 6px; + padding-right: 10px; +} +@media only screen and (max-width: 767px) +{ + .menu_choix1 a, .menu_choix2 a { + background-size: 30px 30px; + height: 30px; + padding-left: 40px; + } + .menu li.menu_choix1, .menu li.menu_choix2 { + padding-left: 4px; + padding-right: 0; + } + .liste_articles { + margin-right: 0 !important; + } +} /* ============================================================================== */ @@ -4378,6 +4401,10 @@ img.demothumb { /* CSS style used for small screen */ /* ============================================================================== */ +.topmenuimage { + background-size: 22px auto; + top: 2px; +} .imgopensurveywizard { padding: 0 4px 0 4px; @@ -4397,6 +4424,16 @@ img.demothumb { margin-left: 4px; width: 80px; } + + div.tabBar { + padding-left: 0px; + padding-right: 0px; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0px; + border-right: none; + border-left: none; + } } /* nboftopmenuentries = , fontsize= */ @@ -4415,7 +4452,7 @@ img.demothumb { font-size: 10px; } .topmenuimage { - background-size: 26px auto; + background-size: 22px auto; margin-top: 0px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3588877adba..475257e6d1c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -633,6 +633,7 @@ div.myavailability { @media only screen and (max-width: 960px) { + .maxwidthonsmartphone { max-width: 100px; } .minwidth50imp { min-width: 50px !important; } .minwidth100imp { min-width: 50px !important; } .minwidth200imp { min-width: 100px !important; } @@ -648,6 +649,7 @@ div.myavailability { .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone { max-width: 100px; } .maxwidth100onsmartphone { max-width: 100px; } + .maxwidth150onsmartphone { max-width: 150px; } .maxwidth200onsmartphone { max-width: 200px; } .maxwidth300onsmartphone { max-width: 300px; } .maxwidth400onsmartphone { max-width: 400px; } @@ -3694,9 +3696,9 @@ div.ecmjqft { /* use or not ? */ div.jnotify-background { opacity : 0.95 !important; - -moz-box-shadow: 3px 3px 4px #888 !important; - -webkit-box-shadow: 3px 3px 4px #888 !important; - box-shadow: 3px 3px 4px #888 !important; + -moz-box-shadow: 2px 2px 4px #888 !important; + -webkit-box-shadow: 2px 2px 4px #888 !important; + box-shadow: 2px 2px 4px #888 !important; } /* ============================================================================== */ @@ -3986,13 +3988,17 @@ dl.dropdown { .dropdown dd ul li { white-space: nowrap; font-weight: normal; + padding: 2px; } .dropdown dd ul li input[type="checkbox"] { margin-right: 3px; } -.dropdown dd ul li a { - padding:5px; - display:block; +.dropdown dd ul li a, .dropdown dd ul li span { + padding: 3px; + display: block; +} +.dropdown dd ul li span { + color: #888; } .dropdown dd ul li a:hover { background-color:#fff; @@ -4288,6 +4294,17 @@ img.demothumb { position: absolute; width: px; } + + div.tabBar { + padding-left: 0px; + padding-right: 0px; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0px; + border-right: none; + border-left: none; + } + } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 1da40878a62..541d847a45b 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -450,7 +450,7 @@ else print ""; print ''; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 6bcd468f62e..a5e9db67867 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -139,7 +139,7 @@ if ($resql) $fuserstatic->email = $obj->email; $fuserstatic->skype = $obj->skype; $fuserstatic->societe_id = $obj->fk_soc; - print $fuserstatic->getNomUrl(1); + print $fuserstatic->getNomUrl(-1); if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) { print img_picto($langs->trans("SuperAdministrator"),'redstar'); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 996a6fba370..ec3691e85db 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -52,7 +52,7 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="a.daten"; +if (! $sortfield) $sortfield="n.daten"; $now=dol_now(); @@ -137,8 +137,11 @@ if ($result > 0) dol_fiche_head($head, 'notify', $langs->trans("User"),0,'user'); - - print '
    '; - print $form->selectarray("contactid",$listofemails); + print '
    '; + print $form->selectarray("contactid", $listofemails, '', 0, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); print ''; - print $form->selectarray("actionid",$actions,'',1); + print ''; + print $form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidthonsmartphone'); print ''; $type=array('email'=>$langs->trans("EMail")); @@ -268,22 +268,7 @@ if ($result > 0) print ''; print '
    '; - // List of active notifications - print load_fiche_titre($langs->trans("ListOfActiveNotifications"),'',''); - $var=true; - - // Line with titles - print ''; - print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); - print_liste_field_titre('','',''); - print ''; - - $langs->load("errors"); - $langs->load("other"); - + // List of notifications enabled for contacts $sql = "SELECT n.rowid, n.type,"; $sql.= " a.code, a.label,"; @@ -294,11 +279,35 @@ if ($result > 0) $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND c.rowid = n.fk_contact"; $sql.= " AND c.fk_soc = ".$object->id; - + $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + } + else + { + dol_print_error($db); + } + + // List of active notifications + print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); + $var=true; + + // Line with titles + print '
    '; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre('','',''); + print ''; + + $langs->load("errors"); + $langs->load("other"); + + if ($num) + { $i = 0; $contactstatic=new Contact($db); @@ -340,10 +349,6 @@ if ($result > 0) } $db->free($resql); } - else - { - dol_print_error($db); - } // List of notifications enabled for fixed email /* @@ -401,20 +406,6 @@ if ($result > 0) print '

    '."\n"; - // List of notifications done - print load_fiche_titre($langs->trans("ListOfNotificationsDone"),'',''); - $var=true; - - // Line with titles - print '
    '; - print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.daten",'',$param,'align="right"',$sortfield,$sortorder); - print ''; - // List $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"; $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; @@ -424,11 +415,34 @@ if ($result > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid"; $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND n.fk_soc = ".$object->id; + $sql.= $db->order($sortfield, $sortorder); $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + } + else + { + dol_print_error($db); + } + + // List of notifications done + print load_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','',''); + $var=true; + + // Line with titles + print '
    '; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"n.daten",'',$param,'align="right"',$sortfield,$sortorder); + print ''; + + if ($num > 0) + { $i = 0; $contactstatic=new Contact($db); @@ -477,10 +491,6 @@ if ($result > 0) } $db->free($resql); } - else - { - dol_print_error($db); - } print '
    '; } diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index 707fe21a010..f99bd517975 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("companies"); +$langs->load("projects"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 0eecd8e6b92..f6315c75833 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -287,7 +287,7 @@ if (empty($reshook)) $object->name_alias = GETPOST('name_alias'); } - $object->address = GETPOST('address', 'alpha'); + $object->address = GETPOST('address'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id', 'int'); @@ -739,7 +739,7 @@ if ($socid > 0 && empty($object->id)) } $title=$langs->trans("ThirdParty"); -if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name; +if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$langs->trans('Card'); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$title,$help_url); @@ -1535,7 +1535,7 @@ else // Prospect/Customer print '
    '.fieldLabel('ProspectCustomer','customerprospect',1).'
    '.fieldLabel('Supplier','fournisseur',1).''; + print ''.fieldLabel('Supplier','fournisseur',1).''; print $form->selectyesno("fournisseur",$object->fournisseur,1); print ''.fieldLabel('SupplierCode','supplier_code').''; @@ -1782,7 +1782,7 @@ else print '
    '.fieldLabel('JuridicalStatus','forme_juridique_code').''; + print '
    '.fieldLabel('JuridicalStatus','forme_juridique_code').''; print $formcompany->select_juridicalstatus($object->forme_juridique_code, $object->country_code, '', 'forme_juridique_code'); print '
    '.fieldLabel('Currency','multicurrency_code').''; - $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)); + $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency)); print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); print '
    '; @@ -1560,7 +1560,7 @@ if ($action == 'create') // Other attributes $cols = 2; if (empty($conf->margin->enabled)) $cols++; - + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; // Amount HT @@ -1609,16 +1609,16 @@ if ($action == 'create') print '
    ' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountVAT','multicurrency_total_tva') . '' . price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    ' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '
    '; $formsupplier_proposal->selectSupplierProposalStatus($viewstatut,1); print ''; - print ''; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; print '
    '; - $objectstatic->id=$objp->supplier_proposalid; - $objectstatic->ref=$objp->ref; - print ''; + // Picto + Ref print ''; - - print ''; - - // Ref + if ($warnornote) + { + print ''; + } + // Other picto tool print '
    '; print $objectstatic->getNomUrl(1); print ''; - if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < ($now - $conf->supplier_proposal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - if (! empty($objp->note_private)) + // Warning + $warnornote=''; + if ($obj->fk_statut == 1 && $db->jdate($obj->date_valid) < ($now - $conf->supplier_proposal->warning_delay)) $warnornote.=img_warning($langs->trans("Late")); + if (! empty($obj->note_private)) { - print ' '; - print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; - print ''; + $warnornote.=($warnornote?' ':''); + $warnornote.= ''; + $warnornote.= ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + $warnornote.= ''; } - print ''; + print $warnornote; + print ''; - $filename=dol_sanitizeFileName($objp->ref); - $filedir=$conf->supplier_proposal->dir_output . '/' . dol_sanitizeFileName($objp->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->supplier_proposalid; + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->supplier_proposal->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '
    '; print "
    '; print $companystatic->getNomUrl(1,'customer'); print ''; - print dol_print_date($db->jdate($objp->date_valid), 'day'); + print dol_print_date($db->jdate($obj->date_valid), 'day'); print "'; - print dol_print_date($db->jdate($objp->dp), 'day'); + print dol_print_date($db->jdate($obj->dp), 'day'); print "'.price($objp->total_ht)."'.price($obj->total_ht)."'; if ($userstatic->id) print $userstatic->getLoginUrl(1); else print ' '; print "'.$objectstatic->LibStatut($objp->fk_statut,5)."'.$objectstatic->LibStatut($obj->fk_statut,5)." '; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; + } + print '
    '; - print ''.img_object($langs->trans("ShowUser"),"user").' '.$useringroup->login.''; + print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar'); else if ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star'); print '
    '; + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); + + /*print '
    '; // Ref print ''; @@ -160,7 +163,7 @@ if ($result > 0) print ''; print "\n"; - print '
    '.$langs->trans("Ref").''.dol_print_email($object->email,0,0,1).'
    '; + print '
    ';*/ dol_fiche_end(); @@ -187,9 +190,9 @@ if ($result > 0) // Line with titles print ''; print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'"width="10%"',$sortfield,$sortorder); print_liste_field_titre(''); print "\n"; @@ -242,22 +245,6 @@ if ($result > 0) print ''; print '
    '; - // List of active notifications - print_fiche_titre($langs->trans("ListOfActiveNotifications"),'',''); - $var=true; - - // Line with titles - print '
    '; - print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'"width="45%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'"width="35%"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'"width="10%"',$sortfield,$sortorder); - print_liste_field_titre('','',''); - print ''; - - $langs->load("errors"); - $langs->load("other"); - // List of notifications enabled for contacts $sql = "SELECT n.rowid, n.type,"; $sql.= " a.code, a.label,"; @@ -268,12 +255,36 @@ if ($result > 0) $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND c.rowid = n.fk_user"; $sql.= " AND c.rowid = ".$object->id; - + $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $i = 0; + } + else + { + dol_print_error($db); + } + + // List of active notifications + print_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')','',''); + $var=true; + + // Line with titles + print '
    '; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'"width="45%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'"width="35%"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'"width="10%"',$sortfield,$sortorder); + print_liste_field_titre('','',''); + print ''; + + $langs->load("errors"); + $langs->load("other"); + + if ($num) + { + $i = 0; $userstatic=new user($db); @@ -314,10 +325,7 @@ if ($result > 0) } $db->free($resql); } - else - { - dol_print_error($db); - } + // List of notifications enabled for fixed email /* @@ -375,20 +383,6 @@ if ($result > 0) print '

    '."\n"; - // List of notifications done - print_fiche_titre($langs->trans("ListOfNotificationsDone"),'',''); - $var=true; - - // Line with titles - print '
    '; - print ''; - print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"a.titre",'',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.daten",'',$param,'align="right"',$sortfield,$sortorder); - print ''; - // List $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,"; $sql.= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,"; @@ -398,11 +392,34 @@ if ($result > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid"; $sql.= " WHERE a.rowid = n.fk_action"; $sql.= " AND n.fk_user = ".$object->id; - + $sql.= $db->order($sortfield, $sortorder); + $resql=$db->query($sql); if ($resql) { $num = $db->num_rows($resql); + } + else + { + dol_print_error($db); + } + + // List of notifications done + print_fiche_titre($langs->trans("ListOfNotificationsDone").' ('.$num.')','',''); + $var=true; + + // Line with titles + print '
    '; + print ''; + print_liste_field_titre($langs->trans("Target"),$_SERVER["PHP_SELF"],"c.lastname,c.firstname",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",'',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"n.type",'',$param,'',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("Object"),$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"n.daten",'',$param,'align="right"',$sortfield,$sortorder); + print ''; + + if ($num) + { $i = 0; $userstatic=new User($db); @@ -451,10 +468,6 @@ if ($result > 0) } $db->free($resql); } - else - { - dol_print_error($db); - } print '
    '; } diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index f439e791cb4..8a12c288d55 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -660,7 +660,7 @@ function updateContact($authentication,$contact) $object->civility_id=$contact['civility_id']; $object->poste=$contact['poste']; - $object->statut=$contact['statut']; + $object->statut=$contact['status']; //Retreive all extrafield for contact diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 28518d24763..de72af93b61 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -935,7 +935,7 @@ function updateOrder($authentication,$order) if (isset($order['billed'])) { if ($order['billed']) $result=$object->classifyBilled($fuser); - if (! $order['billed']) $result=$object->classifyBilled($fuser); + if (! $order['billed']) $result=$object->classifyUnBilled($fuser); } //Retreive all extrafield for object diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 98ec3dd84cd..4ec31ea3789 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -366,7 +366,7 @@ if ($resql) /*elseif ($links[$key]['type']=='sc') { if ($accountelem) $accountelem.= ', '; - //$accountelem.= ''; + //$accountelem.= ''; //$accountelem.= img_object($langs->transnoentitiesnoconv('ShowBill'),'bill').' '; $accountelem.= $langs->transnoentitiesnoconv("SocialContribution"); //$accountelem.= ''; diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 38054c48c69..a0f067b5d0c 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -27,7 +27,6 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOLOGIN')) define('NOLOGIN','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php index 1a8c673c5f9..d381c32676a 100755 --- a/scripts/withdrawals/build_withdrawal_file.php +++ b/scripts/withdrawals/build_withdrawal_file.php @@ -70,6 +70,7 @@ if (! isset($argv[1])) { // Check parameters $withdrawreceipt=new BonPrelevement($db); +// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty $result=$withdrawreceipt->create($conf->global->PRELEVEMENT_CODE_BANQUE,$conf->global->PRELEVEMENT_CODE_GUICHET,$argv[1]); diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 13462afc601..470a570bf6e 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -223,7 +223,7 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase $ip='169.254.0.0'; $result=is_ip($ip); print __METHOD__." for ".$ip." result=".$result."\n"; - $this->assertEquals(0,$result,$ip); + //$this->assertEquals(2,$result,$ip); // Assertion disabled because returned value differs between PHP patch version $ip='1.2.3.4'; $result=is_ip($ip);