diff --git a/COPYRIGHT b/COPYRIGHT index b4cc9752426..cb1dc3e0d29 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -15,8 +15,9 @@ PHP libraries: AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package) ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console CKEditor 4.6.2 LGPL-2.1+ Yes Editor WYSIWYG +PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers EvalMath 1.0 BSD Yes Safe math expressions evaluation -Escpos-php MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers +Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) @@ -24,9 +25,12 @@ PEAR Mail_MIME 1.8.9 BSD Yes odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files ParseDown 1.6 MIT License Yes Markdown parser PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files +PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests +PSR/Logs 1.0 Library for logs (used by DebugBar) +PSR/simple-cache Library for cache (used by PHPSpreadSheet) Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer) TCPDF 6.2.25 LGPL-3+ Yes PDF generation TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement diff --git a/ChangeLog b/ChangeLog index c931f9ea865..08aaaa4b6f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ Following changes may create regressions for some external modules, but were nec * Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.; * Files for variables of themes were renamed from graph-color.php into theme_vars.inc.php to match naming convention of extension .inc.php for files to be included. +* All methods set_draft() were renamed into setDraft(). +* Removed deprecated function function test_sql_and_script_inject that was replaced with testSqlAndScriptInject. ***** ChangeLog for 9.0.1 compared to 9.0.0 ***** diff --git a/dev/initdemo/mysqldump_dolibarr_4.0.0.sql b/dev/initdemo/mysqldump_dolibarr_4.0.0.sql index e8580cdff28..6363873d7c0 100644 --- a/dev/initdemo/mysqldump_dolibarr_4.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_4.0.0.sql @@ -7853,7 +7853,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdemo/mysqldump_dolibarr_5.0.0.sql b/dev/initdemo/mysqldump_dolibarr_5.0.0.sql index 4c31fd25e8a..a66bd427499 100644 --- a/dev/initdemo/mysqldump_dolibarr_5.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_5.0.0.sql @@ -8260,7 +8260,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdemo/mysqldump_dolibarr_6.0.0.sql b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql index f0375a4b407..19cb46d0237 100644 --- a/dev/initdemo/mysqldump_dolibarr_6.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_6.0.0.sql @@ -8612,7 +8612,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdemo/mysqldump_dolibarr_7.0.0.sql b/dev/initdemo/mysqldump_dolibarr_7.0.0.sql index bd5789f0a6b..363cc32670d 100644 --- a/dev/initdemo/mysqldump_dolibarr_7.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_7.0.0.sql @@ -9181,7 +9181,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdemo/mysqldump_dolibarr_8.0.0.sql b/dev/initdemo/mysqldump_dolibarr_8.0.0.sql index 05a4814a7ef..b000b807930 100644 --- a/dev/initdemo/mysqldump_dolibarr_8.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_8.0.0.sql @@ -6360,7 +6360,7 @@ CREATE TABLE `llx_emailcollector_emailcollector` ( LOCK TABLES `llx_emailcollector_emailcollector` WRITE; /*!40000 ALTER TABLE `llx_emailcollector_emailcollector` DISABLE KEYS */; -INSERT INTO `llx_emailcollector_emailcollector` VALUES (1,1,'MyEmailCollector1','My email collector 1','aaa','imap.gmail.com','testldr10@gmail.com','testldr10-10','INBOX','','','aftercollect','2018-11-19 15:21:07','1 emails analyzed, 1 emails successfuly processed (for 3 record/actions done) by collector',NULL,NULL,'2018-10-31 18:08:05','2018-10-31 17:08:05',12,12,NULL,1,'OK',0); +INSERT INTO `llx_emailcollector_emailcollector` VALUES (1,1,'MyEmailCollector1','My email collector 1','aaa','imap.gmail.com','testldr10@example.com','testldr10-10','INBOX','','','aftercollect','2018-11-19 15:21:07','1 emails analyzed, 1 emails successfuly processed (for 3 record/actions done) by collector',NULL,NULL,'2018-10-31 18:08:05','2018-10-31 17:08:05',12,12,NULL,1,'OK',0); /*!40000 ALTER TABLE `llx_emailcollector_emailcollector` ENABLE KEYS */; UNLOCK TABLES; @@ -12450,7 +12450,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2010-07-08 14:26:14','2016-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2010-07-08','Project leader','','','','','','','',NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2010-07-08 22:44:50','2010-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2010-07-08 22:59:02','2016-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2010-07-09 00:16:58','2010-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2011-08-01 02:41:26','2016-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2016-07-30 16:11:06','2016-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2016-07-30 16:13:03','2016-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','','',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2016-07-30 16:14:41','2016-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','','',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2016-07-30 16:26:22','2016-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','','ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','','ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','','Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/initdemo/mysqldump_dolibarr_9.0.0.sql b/dev/initdemo/mysqldump_dolibarr_9.0.0.sql index 61201d931e3..c3d5fcd9e73 100644 --- a/dev/initdemo/mysqldump_dolibarr_9.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_9.0.0.sql @@ -6275,7 +6275,7 @@ CREATE TABLE `llx_emailcollector_emailcollector` ( LOCK TABLES `llx_emailcollector_emailcollector` WRITE; /*!40000 ALTER TABLE `llx_emailcollector_emailcollector` DISABLE KEYS */; -INSERT INTO `llx_emailcollector_emailcollector` VALUES (1,1,'MyEmailCollector1','My email collector 1','aaa','imap.gmail.com','testldr10@gmail.com','testldr10-10','INBOX','','','aftercollect','2018-11-19 15:21:07','1 emails analyzed, 1 emails successfuly processed (for 3 record/actions done) by collector',NULL,NULL,'2018-10-31 18:08:05','2018-10-31 17:08:05',12,12,NULL,1,'OK',0); +INSERT INTO `llx_emailcollector_emailcollector` VALUES (1,1,'MyEmailCollector1','My email collector 1','aaa','imap.gmail.com','testldr10@example.com','testldr10-10','INBOX','','','aftercollect','2018-11-19 15:21:07','1 emails analyzed, 1 emails successfuly processed (for 3 record/actions done) by collector',NULL,NULL,'2018-10-31 18:08:05','2018-10-31 17:08:05',12,12,NULL,1,'OK',0); /*!40000 ALTER TABLE `llx_emailcollector_emailcollector` ENABLE KEYS */; UNLOCK TABLES; @@ -12388,7 +12388,7 @@ CREATE TABLE `llx_socpeople` ( LOCK TABLES `llx_socpeople` WRITE; /*!40000 ALTER TABLE `llx_socpeople` DISABLE KEYS */; -INSERT INTO `llx_socpeople` VALUES (1,'2012-07-08 14:26:14','2018-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2012-07-08','Project leader','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2012-07-08 22:44:50','2012-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2012-07-08 22:59:02','2018-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2012-07-09 00:16:58','2012-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2013-08-01 02:41:26','2018-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2018-07-30 16:11:06','2018-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2018-07-30 16:13:03','2018-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2018-07-30 16:14:41','2018-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2018-07-30 16:26:22','2018-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','eldy@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); +INSERT INTO `llx_socpeople` VALUES (1,'2012-07-08 14:26:14','2018-01-16 15:07:51',1,1,NULL,'MR','Indra','Mahala','','','',297,117,'2012-07-08','Project leader','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,12,'Met during a congress at Dubai','',NULL,NULL,NULL,1),(2,'2012-07-08 22:44:50','2012-07-08 20:59:57',NULL,1,NULL,'MR','Freeman','Public','','','',200,11,NULL,'','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,1,'A friend that is a free contact not linked to any company',NULL,NULL,NULL,NULL,1),(3,'2012-07-08 22:59:02','2018-01-22 17:30:07',NULL,1,NULL,'MR','Mywife','Nicy','','','',NULL,11,'1980-10-03','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,12,'This is a private contact','',NULL,NULL,NULL,1),(4,'2012-07-09 00:16:58','2012-07-08 22:16:58',6,1,NULL,'MR','Rotchield','Evan','','','',NULL,6,NULL,'Bank director','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,1,'The bank director',NULL,NULL,NULL,NULL,1),(6,'2013-08-01 02:41:26','2018-01-22 17:29:53',17,1,NULL,'','Bookkeeper','Bob','99 account street','123456','BigTown',NULL,4,NULL,'book keeper','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,1,12,'','',NULL,NULL,NULL,1),(7,'2018-07-30 16:11:06','2018-07-30 12:16:07',NULL,1,'','MR','Dad','','','','',NULL,14,'1967-09-04','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',1,0,12,12,'','',NULL,NULL,NULL,1),(8,'2018-07-30 16:13:03','2018-07-30 12:15:58',NULL,1,'','MLE','Mom','','','','',NULL,14,NULL,'','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',1,0,12,12,'','',NULL,NULL,NULL,1),(9,'2018-07-30 16:14:41','2018-07-30 12:15:51',NULL,1,'','MR','Francky','','','89455','Virigia',NULL,205,'1980-07-09','Baker','555-98989898','','','','francky@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',0,0,12,12,'','',NULL,NULL,NULL,1),(10,'2018-07-30 16:26:22','2018-07-30 12:52:38',10,1,'','MR','Eldy','','','33600','Pessac',NULL,1,'1972-10-10','Dolibarr project leader','','','','','demo@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ldestailleur_200x200.jpg',0,0,NULL,12,'','',NULL,NULL,NULL,1),(11,'2017-05-12 13:16:36','2017-05-12 09:18:20',11,1,'','MR','Smith','Laurent','45 Big road','897','Seattle',NULL,11,NULL,'Director','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'ldestailleur_200x200.png',0,0,12,12,'','',NULL,NULL,NULL,1),(12,'2017-05-12 13:19:31','2017-05-12 09:19:42',11,1,'','MR','Einstein','','','','',NULL,11,NULL,'Genius','333444555','','','','genius@example.com','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Einstein.jpg',0,0,12,12,'','',NULL,NULL,NULL,1); /*!40000 ALTER TABLE `llx_socpeople` ENABLE KEYS */; UNLOCK TABLES; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index decae324ac5..faba7fb1c62 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -60,7 +60,7 @@ $accountingcategory = new AccountancyCategory($db); // si ajout de comptes if (! empty($selectcpt)) { - $cpts = array (); + $cpts = array(); foreach ($selectcpt as $selectedoption) { if (! array_key_exists($selectedoption, $cpts)) $cpts[$selectedoption] = "'" . $selectedoption . "'"; @@ -71,13 +71,13 @@ if (! empty($selectcpt)) { if ($return<0) { setEventMessages($langs->trans('errors'), $accountingcategory->errors, 'errors'); } else { - setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + setEventMessages($langs->trans('RecordModifiedSuccessfully'), null, 'mesgs'); } } if ($action == 'delete') { if ($cpt_id) { if ($accountingcategory->deleteCptCat($cpt_id)) { - setEventMessages($langs->trans('CategoryDeleted'), null, 'mesgs'); + setEventMessages($langs->trans('AccountRemovedFromGroup'), null, 'mesgs'); } else { setEventMessages($langs->trans('errors'), null, 'errors'); } @@ -173,8 +173,9 @@ if ($action == 'display' || $action == 'delete') { print '' . $cpt->label . ''; print ''; print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; print ""; print "\n"; } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index df8ce99fa10..07df2a91872 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -65,6 +65,8 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); $btn_changeaccount = GETPOST('changeaccount', 'alpha'); $btn_changetype = GETPOST('changetype', 'alpha'); +if (empty($accounting_product_mode)) $accounting_product_mode='ACCOUNTANCY_SELL'; + $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -112,8 +114,6 @@ if ($action == 'update') { 'ACCOUNTANCY_BUY' ); - $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha'); - if (in_array($accounting_product_mode, $accounting_product_modes)) { if (! dolibarr_set_const($db, 'ACCOUNTING_PRODUCT_MODE', $accounting_product_mode, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 73cccdfd721..523fba7acda 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -38,7 +38,7 @@ class AccountancyCategory // extends CommonObject /** * @var string Error string - * @see errors + * @see $errors */ public $error; @@ -63,7 +63,7 @@ class AccountancyCategory // extends CommonObject public $id; /** - * @var mixed Sample property 1 + * @var string Accountancy code */ public $code; @@ -73,7 +73,7 @@ class AccountancyCategory // extends CommonObject public $label; /** - * @var mixed Sample property 1 + * @var string Accountancy range account */ public $range_account; @@ -83,37 +83,37 @@ class AccountancyCategory // extends CommonObject public $sens; /** - * @var mixed Sample property 1 + * @var int Category type of accountancy */ public $category_type; /** - * @var mixed Sample property 1 + * @var string Formula */ public $formula; /** - * @var mixed Sample property 1 + * @var int Position */ public $position; /** - * @var mixed Sample property 1 + * @var int country id */ public $fk_country; /** - * @var mixed Sample property 1 + * @var int Is active */ public $active; /** - * @var mixed Sample property 1 + * @var array Lines cptbk */ public $lines_cptbk; /** - * @var mixed Sample property 1 + * @var array Lines display */ public $lines_display; @@ -151,12 +151,12 @@ class AccountancyCategory // extends CommonObject if (isset($this->code)) $this->code=trim($this->code); if (isset($this->label)) $this->label=trim($this->label); if (isset($this->range_account)) $this->range_account=trim($this->range_account); - if (isset($this->sens)) $this->sens=trim($this->sens); - if (isset($this->category_type)) $this->category_type=trim($this->category_type); + if (isset($this->sens)) $this->sens = (int) $this->sens; + if (isset($this->category_type)) $this->category_type = (int) $this->category_type; if (isset($this->formula)) $this->formula=trim($this->formula); - if (isset($this->position)) $this->position=trim($this->position); - if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country); - if (isset($this->active)) $this->active=trim($this->active); + if (isset($this->position)) $this->position = (int) $this->position; + if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country; + if (isset($this->active)) $this->active = (int) $this->active; // Check parameters // Put here code to add control on parameters values @@ -308,12 +308,12 @@ class AccountancyCategory // extends CommonObject if (isset($this->code)) $this->code=trim($this->code); if (isset($this->label)) $this->label=trim($this->label); if (isset($this->range_account)) $this->range_account=trim($this->range_account); - if (isset($this->sens)) $this->sens=trim($this->sens); - if (isset($this->category_type)) $this->category_type=trim($this->category_type); + if (isset($this->sens)) $this->sens = (int) $this->sens; + if (isset($this->category_type)) $this->category_type = (int) $this->category_type; if (isset($this->formula)) $this->formula=trim($this->formula); - if (isset($this->position)) $this->position=trim($this->position); - if (isset($this->fk_country)) $this->fk_country=trim($this->fk_country); - if (isset($this->active)) $this->active=trim($this->active); + if (isset($this->position)) $this->position = (int) $this->position; + if (isset($this->fk_country)) $this->fk_country = (int) $this->fk_country; + if (isset($this->active)) $this->active = (int) $this->active; // Check parameters @@ -338,8 +338,8 @@ class AccountancyCategory // extends CommonObject $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - if (! $error) - { + //if (! $error) + //{ // Uncomment this and change MYOBJECT to your own tag if you // want this action call a trigger. //if (! $notrigger) @@ -351,7 +351,7 @@ class AccountancyCategory // extends CommonObject // if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers //} - } + //} // Commit or rollback if ($error) @@ -393,8 +393,8 @@ class AccountancyCategory // extends CommonObject $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - if (! $error) - { + //if (! $error) + //{ // Uncomment this and change MYOBJECT to your own tag if you // want this action call a trigger. //if (! $notrigger) @@ -406,7 +406,7 @@ class AccountancyCategory // extends CommonObject // if ($result < 0) { $error++; $this->errors=$interface->errors; } // // End call triggers //} - } + //} // Commit or rollback if ($error) @@ -514,7 +514,7 @@ class AccountancyCategory // extends CommonObject /** * Function to select accounting category of an accounting account present in chart of accounts * - * @param int $id Id category + * @param int $id Id of category to know which account to exclude * * @return int <0 if KO, 0 if not found, >0 if OK */ @@ -569,12 +569,13 @@ class AccountancyCategory // extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; - $sql = "SELECT aa.rowid,aa.account_number "; + $sql = "SELECT aa.rowid, aa.account_number"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS; $sql .= " AND aa.active = 1"; $sql .= " AND aa.entity = " . $conf->entity; + $sql .= " ORDER BY LENGTH(aa.account_number) DESC;"; // LENGTH is ok with mysql and postgresql $this->db->begin(); @@ -587,10 +588,16 @@ class AccountancyCategory // extends CommonObject return -1; } - while ( $obj = $this->db->fetch_object($resql)) + $accountincptsadded=array(); + while ($obj = $this->db->fetch_object($resql)) { - if (array_key_exists(length_accountg($obj->account_number), $cpts)) + $account_number_formated=length_accountg($obj->account_number); + if (! empty($accountincptsadded[$account_number_formated])) continue; + + if (array_key_exists($account_number_formated, $cpts)) { + $accountincptsadded[$account_number_formated]=1; + // We found an account number that is in list $cpts of account to add $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account"; $sql .= " SET fk_accounting_category=" . $id_cat; $sql .= " WHERE rowid=".$obj->rowid; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 90b722d7959..a641ccb4db5 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -31,20 +31,15 @@ * \brief Class accountancy export */ -/** - * Class AccountancyExport - * - * Manage the different format accountancy export - */ - require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php'; +/** + * Manage the different format accountancy export + */ class AccountancyExport { - /** - * Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV - */ - public static $EXPORT_TYPE_NORMAL = 1; // CSV + // Type of export. Used into $conf->global->ACCOUNTING_EXPORT_MODELCSV + public static $EXPORT_TYPE_NORMAL = 1; // CSV public static $EXPORT_TYPE_CONFIGURABLE = 10; // CSV public static $EXPORT_TYPE_CEGID = 2; public static $EXPORT_TYPE_COALA = 3; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index ca66201dac7..b34efe5ea04 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -64,13 +64,13 @@ if ($conf->accounting->enabled) // STEPS $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").''.''); print "
\n"; print "
\n"; @@ -79,20 +79,20 @@ if ($conf->accounting->enabled) print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''.''); print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").''.'')."\n"; print "
\n"; $step++; - $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").''.''; + $textlink = ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").''.''; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink); print "
\n"; if (! empty($conf->tax->enabled)) { - $textlink = ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").''.''; + $textlink = ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").''.''; $step++; print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink); print "
\n"; @@ -100,7 +100,7 @@ if ($conf->accounting->enabled) /*if (! empty($conf->salaries->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); // htdocs/admin/salaries.php print "
\n"; print "
\n"; @@ -108,36 +108,37 @@ if ($conf->accounting->enabled) if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several. { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").''.''); print "
\n"; } /* if (! empty($conf->loan->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, ''.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").' '.$langs->transnoentitiesnoconv("or").' '.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, ''.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").' '.$langs->transnoentitiesnoconv("or").' '.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); print "
\n"; } if (! empty($conf->don->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); print "
\n"; } if (! empty($conf->adherents->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, ''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); print "
\n"; }*/ $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").''.''); + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.''.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").''.''); print "
\n"; print '
'; + // Step A - E print "
\n"; print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionFreq"), '', ''); @@ -148,22 +149,22 @@ if ($conf->accounting->enabled) $langs->loadLangs(array('bills', 'trips')); $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").''.'')."\n"; print "
\n"; $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").''.'')."\n"; print "
\n"; if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled)) { $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").''.'')."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.''.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").''.'')."\n"; print "
\n"; } $step++; - print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n"; + print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n"; print "
\n"; $step++; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index d4b77342c84..9a84782e920 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -587,7 +587,7 @@ class Adherent extends CommonObject } } } - + dol_syslog(get_class($this)."::update update member", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -1866,7 +1866,7 @@ class Adherent extends CommonObject $error=0; - // Check paramaters + // Check parameters if ($this->statut == 0) { dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING); @@ -2149,7 +2149,7 @@ class Adherent extends CommonObject * @param int $statut Id statut * @param int $need_subscription 1 if member type need subscription, 0 otherwise * @param int $date_end_subscription Date fin adhesion - * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ public function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0) @@ -2209,7 +2209,7 @@ class Adherent extends CommonObject } elseif ($mode == 5) { - if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); + if ($statut == -1) return ''.$langs->trans("MemberStatusDraftShort").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); elseif ($statut >= 1) { if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActiveShort").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1'); elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLateShort").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); @@ -2219,13 +2219,13 @@ class Adherent extends CommonObject } elseif ($mode == 6) { - if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); + if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'), 'statut0'); if ($statut >= 1) { - if (! $date_end_subscription) return ''.$langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1'); - elseif ($date_end_subscription < time()) return ''.$langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); - else return ''.$langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4'); + if (! $date_end_subscription) return $langs->trans("MemberStatusActive").' '.img_picto($langs->trans('MemberStatusActive'), 'statut1'); + elseif ($date_end_subscription < time()) return $langs->trans("MemberStatusActiveLate").' '.img_picto($langs->trans('MemberStatusActiveLate'), 'statut3'); + else return $langs->trans("MemberStatusPaid").' '.img_picto($langs->trans('MemberStatusPaid'), 'statut4'); } - if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5'); + if ($statut == 0) return $langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'), 'statut5'); } } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index bd5f70d0973..35e1fd1553f 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -436,23 +436,23 @@ if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) if (! empty($arrayfields['d.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['d.civility']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.firstname']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.lastname']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.gender']['checked'])) { @@ -464,12 +464,12 @@ if (! empty($arrayfields['d.gender']['checked'])) if (! empty($arrayfields['d.company']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.login']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.morphy']['checked'])) { @@ -487,24 +487,24 @@ if (! empty($arrayfields['t.libelle']['checked'])) if (! empty($arrayfields['d.address']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.zip']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.town']['checked'])) { print ''; - print ''; + print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Country @@ -518,7 +518,7 @@ if (! empty($arrayfields['country.code_iso']['checked'])) if (! empty($arrayfields['d.phone']['checked'])) { print ''; - print ''; + print ''; } // Phone perso if (! empty($arrayfields['d.phone_perso']['checked'])) @@ -530,13 +530,13 @@ if (! empty($arrayfields['d.phone_perso']['checked'])) if (! empty($arrayfields['d.phone_mobile']['checked'])) { print ''; - print ''; + print ''; } // Email if (! empty($arrayfields['d.email']['checked'])) { print ''; - print ''; + print ''; } if (! empty($arrayfields['d.datefin']['checked'])) diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php new file mode 100644 index 00000000000..34cc06c5f08 --- /dev/null +++ b/htdocs/admin/debugbar.php @@ -0,0 +1,104 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2013 Juanjo Menent + * + * 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/admin/debugbar.php + * \ingroup debugbar + * \brief Setup page for debugbar module + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +global $conf; + +if (!$user->admin) accessforbidden(); + +// Load translation files required by the page +$langs->loadLangs(array("admin","other")); + +$error=0; +$action = GETPOST('action', 'aZ09'); + + +/* + * Actions + */ + +// Set modes +if ($action == 'set') +{ + $db->begin(); + + $result = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); + if ($result < 0) + { + $error++; + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + setEventMessages($error, $errors, 'errors'); + } +} + + +/* + * View + */ + +llxHeader(); + +$form=new Form($db); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup'); +print '
'; + +//print load_fiche_titre($langs->trans("DebugBar")); + +// Level +print '
'; +print ''; +print ''; + +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DEBUGBAR_LOGS_LINES_NUMBER").''; // This slow seriously output +print ' '.$langs->trans("WarningValueHigherSlowsDramaticalyOutput"); +print '
'; +print "
\n"; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index e1d65250b6d..b1c9df224ea 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -77,8 +77,7 @@ if ($action == 'updateMask') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'specimen') +elseif ($action == 'specimen') { $modele=GETPOST('module', 'alpha'); @@ -122,7 +121,6 @@ else if ($action == 'specimen') dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } - // Activate a model elseif ($action == 'set') { @@ -137,7 +135,6 @@ elseif ($action == 'del') if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity); } } - // Set default model elseif ($action == 'setdoc') { @@ -155,7 +152,6 @@ elseif ($action == 'setdoc') $ret = addDocumentModel($value, $type, $label, $scandir); } } - elseif ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active @@ -163,8 +159,7 @@ elseif ($action == 'setmod') dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); } - -else if ($action == 'setribchq') +elseif ($action == 'setribchq') { $rib = GETPOST('rib', 'alpha'); $chq = GETPOST('chq', 'alpha'); @@ -183,8 +178,7 @@ else if ($action == 'setribchq') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'set_FACTURE_DRAFT_WATERMARK') +elseif ($action == 'set_FACTURE_DRAFT_WATERMARK') { $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); @@ -202,7 +196,7 @@ else if ($action == 'set_FACTURE_DRAFT_WATERMARK') } } -else if ($action == 'set_INVOICE_FREE_TEXT') +elseif ($action == 'set_INVOICE_FREE_TEXT') { $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -219,8 +213,7 @@ else if ($action == 'set_INVOICE_FREE_TEXT') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'setforcedate') +elseif ($action == 'setforcedate') { $forcedate = GETPOST('forcedate', 'alpha'); @@ -237,8 +230,7 @@ else if ($action == 'setforcedate') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'setDefaultPDFModulesByType') +elseif ($action == 'setDefaultPDFModulesByType') { $invoicetypemodels = GETPOST('invoicetypemodels'); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index d903c592bfe..612883dac38 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -139,7 +139,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); @@ -259,11 +259,18 @@ if ($action == 'edit') // Edit print '
'; // Other - print ''; + print '
'; print ''; print ''; print ''; + // Disable javascript and ajax + print ''; + print ''; + print ''; + // Max size of lists print ''; print ''; @@ -283,13 +290,6 @@ if ($action == 'edit') // Edit print ''; */ - // Disable javascript and ajax - print ''; - print ''; - print ''; - // First day for weeks print ''; - $nbphoto++; - } - - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("DisableJavascript").''; + print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); + print ' 
'.$langs->trans("DefaultMaxSizeList").' 
'.$langs->trans("DisableJavascript").''; - print $form->selectyesno('main_disable_javascript', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); - print ' 
'.$langs->trans("WeekStartOnDay").''; print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'), 'MAIN_START_WEEK', 0); @@ -468,17 +468,21 @@ else // Show print ''; print ''; + // Disable javascript/ajax + print '"; + print ""; + + // Max size of lists print ''; print ""; + // Max size of short lists print ''; print ""; - // Disable javascript/ajax - print '"; - print ""; - // First day for weeks print ''; // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip = $langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { @@ -526,7 +519,7 @@ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("DisableJavascript").''; + print yn($conf->global->MAIN_DISABLE_JAVASCRIPT); + print '   -   '.$langs->trans("DisableJavascriptNote").''; + print "
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '
'.$langs->trans("DisableJavascript").''; - print yn($conf->global->MAIN_DISABLE_JAVASCRIPT)."
'.$langs->trans("WeekStartOnDay").''; print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1')); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 34e407bd863..144ec744d41 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -173,7 +173,7 @@ if ($action == 'specimen') } // Set default model -else if ($action == 'setdoc') +elseif ($action == 'setdoc') { if (dolibarr_set_const($db, "PAYMENTORDER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index e9a037b98c9..db41876b02c 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -69,8 +69,7 @@ if ($action == 'updateMask') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'specimen') +elseif ($action == 'specimen') { $modele=GETPOST('module', 'alpha'); @@ -114,14 +113,13 @@ else if ($action == 'specimen') dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } - -else if ($action == 'setribchq') +elseif ($action == 'setribchq') { - $rib = GETPOST('rib','alpha'); - $chq = GETPOST('chq','alpha'); + $rib = GETPOST('rib', 'alpha'); + $chq = GETPOST('chq', 'alpha'); - $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -134,8 +132,7 @@ else if ($action == 'setribchq') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'set_PROPALE_DRAFT_WATERMARK') +elseif ($action == 'set_PROPALE_DRAFT_WATERMARK') { $draft = GETPOST('PROPALE_DRAFT_WATERMARK', 'alpha'); @@ -151,8 +148,7 @@ else if ($action == 'set_PROPALE_DRAFT_WATERMARK') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'set_PROPOSAL_FREE_TEXT') +elseif ($action == 'set_PROPOSAL_FREE_TEXT') { $freetext = GETPOST('PROPOSAL_FREE_TEXT', 'none'); // No alpha here, we want exact string @@ -169,8 +165,7 @@ else if ($action == 'set_PROPOSAL_FREE_TEXT') setEventMessages($langs->trans("Error"), null, 'errors'); } } - -else if ($action == 'setdefaultduration') +elseif ($action == 'setdefaultduration') { $res = dolibarr_set_const($db, "PROPALE_VALIDITY_DURATION", $value, 'chaine', 0, '', $conf->entity); @@ -186,7 +181,7 @@ else if ($action == 'setdefaultduration') } } -else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') +elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL", $value, 'chaine', 0, '', $conf->entity); @@ -201,13 +196,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') setEventMessages($langs->trans("Error"), null, 'errors'); } } - // Activate a model -else if ($action == 'set') +elseif ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } - elseif ($action == 'del') { $ret = delDocumentModel($value, $type); @@ -476,7 +469,7 @@ foreach ($dirmodels as $reldir) print '
'; if (empty($conf->facture->enabled)) { print '
'; - print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"),'',''); + print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInProposal"), '', ''); print '
'; print ''; @@ -608,7 +601,7 @@ if (empty($conf->facture->enabled)) print ''; + print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).''; $i++; } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 2d6b68fcb93..69c2c48ffca 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -269,7 +269,7 @@ print '
'."\n\n"; print load_fiche_titre($langs->trans("SyslogLevel")); // Level -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index a028d1ccd7f..67f75c911aa 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2019 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 @@ -70,6 +70,18 @@ else } print '
'; +// Module debugbar +print '
'; +print ''.$langs->trans("DebugBar").': '; +$test=empty($conf->debugbar->enabled); +if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled"); +else +{ + print img_picto('', 'warning').' '.$langs->trans("DebugBarModuleActivated"); + //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; +} +print '
'; + // Applicative cache print '
'; print ''.$langs->trans("ApplicativeCache").': '; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index b0ffd62155c..baa2ced0c4a 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -387,7 +387,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print '
'; @@ -509,7 +509,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''; + if (! empty($totalarray['pos'][$i])) print ''; else { if ($i == 1) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 47aae86db04..a4b70660c7f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -70,6 +70,7 @@ class BOM extends CommonObject * 'label' the translation key. * 'enabled' is a condition when the field must be managed. * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'default' is a default value for creation (can still be replaced by the global setup of default values) * 'index' if we want an index in database. @@ -90,7 +91,7 @@ class BOM extends CommonObject */ public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1',), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-1, 'position'=>61, 'notnull'=>-1,), @@ -103,7 +104,7 @@ class BOM extends CommonObject 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp'), - 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1',), + 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Enabled', '-1'=>'Disabled')), ); public $rowid; @@ -289,6 +290,24 @@ class BOM extends CommonObject $this->lines=array(); // Load lines with object BOMLine + $sql = 'SELECT rowid, fk_product, description, qty, rank WHERE fk_bom = '.$this->id; + + $resql=$this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $newline = new BOMLine($this->db); + $newline->id = $obj->rowid; + $newline->fk_product = $obj->fk_product; + $newline->description = $obj->description; + $newline->qty = $obj->qty; + $newline->rank = $obj->rank; + + $this->lines[] = $newline; + } + } return count($this->lines)?1:0; } @@ -397,6 +416,62 @@ class BOM extends CommonObject } + /** + * Returns the reference to the following non used BOM depending on the active numbering module + * defined into BOM_ADDON + * + * @param Product $prod Object product + * @return string BOM free reference + */ + public function getNextNumRef($prod) + { + global $langs, $conf; + $langs->load("mrp"); + + if (! empty($conf->global->BOM_ADDON)) + { + $mybool=false; + + $file = $conf->global->BOM_ADDON.".php"; + $classname = $conf->global->BOM_ADDON; + + // Include file with class + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + $dir = dol_buildpath($reldir."core/modules/bom/"); + + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + + if ($mybool === false) + { + dol_print_error('', "Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = $obj->getNextValue($prod, $this); + + if ($numref != "") + { + return $numref; + } + else + { + $this->error=$obj->error; + //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); + return ""; + } + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_BOM_ADDON_NotDefined"); + return ""; + } + } + /** * Validate bom * @@ -433,7 +508,8 @@ class BOM extends CommonObject // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { - $num = $this->getNextNumRef(); + $this->fetch_product(); + $num = $this->getNextNumRef($this->product); } else { @@ -520,7 +596,6 @@ class BOM extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set draft status * @@ -529,7 +604,6 @@ class BOM extends CommonObject */ public function setDraft($user) { - //phpcs:enable global $conf,$langs; $error=0; @@ -889,36 +963,6 @@ class BOMLine extends CommonObject // END MODULEBUILDER PROPERTIES - - // If this object has a subtable with lines - - /** - * @var int Name of subtable line - */ - //public $table_element_line = 'bomlinedet'; - - /** - * @var int Field with ID of parent key if this field has a parent - */ - //public $fk_element = 'fk_bomline'; - - /** - * @var int Name of subtable class that manage subtable lines - */ - //public $class_element_line = 'BillOfMaterialsLineline'; - - /** - * @var array Array of child tables (child tables to delete before deleting a record) - */ - //protected $childtables=array('bomlinedet'); - - /** - * @var BillOfMaterialsLineLine[] Array of subtable lines - */ - //public $lines = array(); - - - /** * Constructor * @@ -1351,35 +1395,4 @@ class BOMLine extends CommonObject { $this->initAsSpecimenCommon(); } - - - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - //public function doScheduledJob($param1, $param2, ...) - public function doScheduledJob() - { - global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error=''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } } diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index fd198e043e9..e506906808a 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -31,7 +31,7 @@ if (!$user->admin) accessforbidden(); // Load translation files required by the page -$langs->load("categories"); +$langs->loadLangs(array("categories","admin")); $action=GETPOST('action', 'aZ09'); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 4b6f92a03d5..5db9b4be136 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -909,7 +909,7 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return childs of a category + * Return direct childs id of a category into an array * * @return array|int <0 KO, array ok */ @@ -922,7 +922,7 @@ class Categorie extends CommonObject $res = $this->db->query($sql); if ($res) { - $cats = array (); + $cats = array(); while ($rec = $this->db->fetch_array($res)) { $cat = new Categorie($this->db); @@ -940,16 +940,14 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load this->motherof that is array(id_son=>id_parent, ...) + * Load the array this->motherof that is array(id_son=>id_parent, ...) * * @return int <0 if KO, >0 if OK */ protected function load_motherof() { // phpcs:enable - global $conf; - - $this->motherof=array(); + $this->motherof=array(); // Load array[child]=parent $sql = "SELECT fk_parent as id_parent, rowid as id_son"; @@ -985,12 +983,12 @@ class Categorie extends CommonObject * fulllabel = nom avec chemin complet de la categorie * fullpath = chemin complet compose des id * - * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...). - * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. - * - * @return array|int Array of categories. this->cats and this->motherof are set, -1 on error + * @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...). + * @param int $markafterid Removed all categories including the leaf $markafterid in category tree. + * @param int $keeponlyifinleafid Keep only of category is inside the leaf starting with this id. + * @return array|int Array of categories. this->cats and this->motherof are set, -1 on error */ - public function get_full_arbo($type, $markafterid = 0) + public function get_full_arbo($type, $markafterid = 0, $keeponlyifinleafid = 0) { // phpcs:enable global $conf, $langs; @@ -1007,9 +1005,9 @@ class Categorie extends CommonObject $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'"; $sql .= " WHERE c.entity IN (" . getEntity('category') . ")"; - $sql .= " AND c.type = " . $type; + $sql .= " AND c.type = " . (int) $type; dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1059,6 +1057,27 @@ class Categorie extends CommonObject } } } + // Exclude leaf including $markafterid from tree + if ($keeponlyifinleafid) + { + //print "Look to discard category ".$keeponlyifinleafid."\n"; + $keyfilter1='^'.$keeponlyifinleafid.'$'; + $keyfilter2='_'.$keeponlyifinleafid.'$'; + $keyfilter3='^'.$keeponlyifinleafid.'_'; + $keyfilter4='_'.$keeponlyifinleafid.'_'; + foreach($this->cats as $key => $val) + { + if (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) + || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])) + { + // We keep + } + else + { + unset($this->cats[$key]); + } + } + } dol_syslog(get_class($this)."::get_full_arbo dol_sort_array", LOG_DEBUG); $this->cats=dol_sort_array($this->cats, 'fulllabel', 'asc', true, false); @@ -1070,7 +1089,8 @@ class Categorie extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * For category id_categ and its childs available in this->cats, define property fullpath and fulllabel + * For category id_categ and its childs available in this->cats, define property fullpath and fulllabel. + * This function is a memory scan only from $this->cats and $this->motherof, no database access must be done here. * * @param int $id_categ id_categ entry to update * @param int $protection Deep counter to avoid infinite loop @@ -1174,6 +1194,19 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Returns the top level categories (which are not child) + * + * @param int $type Type of category (0, 1, ...) + * @return array + */ + public function get_main_categories($type = null) + { + // phpcs:enable + return $this->get_all_categories($type, true); + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Check if no category with same label already exists for this cat's parent or root and for this cat's type @@ -1225,18 +1258,6 @@ class Categorie extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Returns the top level categories (which are not girls) - * - * @param int $type Type of category (0, 1, ...) - * @return array - */ - public function get_main_categories($type = null) - { - // phpcs:enable - return $this->get_all_categories($type, true); - } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index df300961fb1..0b2ac7c1b0c 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -218,66 +218,70 @@ if ($object->id) $pdir = get_exdir($object->id, 2, 0, 0, $object, 'category') . $object->id ."/photos/"; $dir = $upload_dir.'/'.$pdir; - print '
'; - print '
'; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''.price($totalarray['val'][$totalarray['pos'][$i]]).'
'; + $listofphoto = $object->liste_photos($dir); - foreach ($object->liste_photos($dir) as $key => $obj) + if (is_array($listofphoto) && count($listofphoto)) { - $nbphoto++; + print '
'; + print '
'; + foreach ($listofphoto as $key => $obj) + { + $nbphoto++; - if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print ''; - if ($nbbyrow) print ''; + if ($nbbyrow) print ''; - if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; + // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites + if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) + { + print ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; + } + if ($user->rights->categorie->creer) + { + print ''; + print img_delete().''; + } + if ($nbbyrow) print ''; + if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; + } + + // Ferme tableau + while ($nbphoto % $nbbyrow) + { + print ''; + $nbphoto++; + } + + print '
'; + if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '
'; - print ''; + print ''; - // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine - if ($obj['photo_vignette']) - { - $filename=$obj['photo_vignette']; - } - else - { - $filename=$obj['photo']; - } + // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine + if ($obj['photo_vignette']) + { + $filename=$obj['photo_vignette']; + } + else + { + $filename=$obj['photo']; + } - // Nom affiche - $viewfilename=$obj['photo']; + // Nom affiche + $viewfilename=$obj['photo']; - // Taille de l'image - $object->get_image_size($dir.$filename); - $imgWidth = ($object->imgWidth < $maxWidth) ? $object->imgWidth : $maxWidth; - $imgHeight = ($object->imgHeight < $maxHeight) ? $object->imgHeight : $maxHeight; + // Taille de l'image + $object->get_image_size($dir.$filename); + $imgWidth = ($object->imgWidth < $maxWidth) ? $object->imgWidth : $maxWidth; + $imgHeight = ($object->imgHeight < $maxHeight) ? $object->imgHeight : $maxHeight; - print ''; + print ''; - print ''; - print '
'.$viewfilename; - print '
'; + print ''; + print '
'.$viewfilename; + print '
'; - // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) - { - print ''.img_picto($langs->trans('GenerateThumb'), 'refresh').'  '; - } - if ($user->rights->categorie->creer) - { - print ''; - print img_delete().''; - } - if ($nbbyrow) print '
 
'; } - // Ferme tableau - while ($nbphoto % $nbbyrow) - { - print '
 
'; - if ($nbphoto < 1) { print '
'.$langs->trans("NoPhotoYet")."
"; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 1f6e9280475..a7170b799a2 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -313,7 +313,7 @@ else } else { - print "'.$langs->trans("NoSubCat").""; + print ''.$langs->trans("NoSubCat").''; } print "\n"; } @@ -342,10 +342,9 @@ if ($type == Categorie::TYPE_PRODUCT) print ''; print ''; print ''; - print ''; print ''; print '
'; + print '
'; print $langs->trans("AddProductServiceIntoCategory").'  '; print $form->select_produits('', 'elemid', '', 0, 0, -1, 2, '', 1); - print ''; print '
'; @@ -354,7 +353,7 @@ if ($type == Categorie::TYPE_PRODUCT) print "
"; print "\n"; - print '\n"; + print ''."\n"; if (count($prods) > 0) { @@ -376,8 +375,9 @@ if ($type == Categorie::TYPE_PRODUCT) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print ''; print "\n"; @@ -385,7 +385,7 @@ if ($type == Categorie::TYPE_PRODUCT) } else { - print ""; + print ''; } print "
'.$langs->trans("ProductsAndServices")." (".count($prods).")
'.$langs->trans("ProductsAndServices").' '.count($prods).'
'.$langs->trans("ThisCategoryHasNoProduct")."
'.$langs->trans("ThisCategoryHasNoProduct").'
\n"; } @@ -402,7 +402,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { print "
"; print ''."\n"; - print '\n"; + print '\n"; if (count($socs) > 0) { @@ -423,8 +423,9 @@ if ($type == Categorie::TYPE_SUPPLIER) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print ''; @@ -433,7 +434,7 @@ if ($type == Categorie::TYPE_SUPPLIER) } else { - print ''; + print ''; } print "
'.$langs->trans("Suppliers")." (".count($socs).")
'.$langs->trans("Suppliers").' '.count($socs)."
'.$langs->trans("ThisCategoryHasNoSupplier").'
'.$langs->trans("ThisCategoryHasNoSupplier").'
\n"; } @@ -450,7 +451,7 @@ if($type == Categorie::TYPE_CUSTOMER) { print "
"; print ''."\n"; - print '\n"; + print ''."\n"; if (count($socs) > 0) { @@ -476,8 +477,9 @@ if($type == Categorie::TYPE_CUSTOMER) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print ''; print "\n"; @@ -485,7 +487,7 @@ if($type == Categorie::TYPE_CUSTOMER) } else { - print ''; + print ''; } print "
'.$langs->trans("Customers")." (".count($socs).")
'.$langs->trans("Customers").' '.count($socs).'
'.$langs->trans("ThisCategoryHasNoCustomer").'
'.$langs->trans("ThisCategoryHasNoCustomer").'
\n"; } @@ -505,7 +507,7 @@ if ($type == Categorie::TYPE_MEMBER) { print "
"; print "\n"; - print '\n"; + print ''."\n"; if (count($prods) > 0) { @@ -529,15 +531,16 @@ if ($type == Categorie::TYPE_MEMBER) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print "\n"; } } else { - print ''; + print ''; } print "
'.$langs->trans("Member")." (".count($prods).")
'.$langs->trans("Member").' '.count($prods).'
'.$langs->trans("ThisCategoryHasNoMember").'
'.$langs->trans("ThisCategoryHasNoMember").'
\n"; } @@ -555,7 +558,7 @@ if ($type == Categorie::TYPE_CONTACT) { print "
"; print ''."\n"; - print '\n"; + print ''."\n"; if (count($contacts) > 0) { @@ -579,8 +582,9 @@ if ($type == Categorie::TYPE_CONTACT) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print ''; print "\n"; @@ -588,7 +592,7 @@ if ($type == Categorie::TYPE_CONTACT) } else { - print ''; + print ''; } print "
'.$langs->trans("Contact")." (".count($contacts).")
'.$langs->trans("Contact").' '.count($contacts).'
'.$langs->trans("ThisCategoryHasNoContact").'
'.$langs->trans("ThisCategoryHasNoContact").'
\n"; } @@ -608,7 +612,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { print "
"; print "\n"; - print '\n"; + print ''."\n"; if (count($accounts) > 0) { @@ -631,15 +635,16 @@ if ($type == Categorie::TYPE_ACCOUNT) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print "\n"; } } else { - print ''; + print ''; } print "
'.$langs->trans("Account")." (".count($accounts).")
'.$langs->trans("Account").' '.count($accounts).'
'.$langs->trans("ThisCategoryHasNoAccount").'
'.$langs->trans("ThisCategoryHasNoAccount").'
\n"; } @@ -659,7 +664,7 @@ if ($type == Categorie::TYPE_PROJECT) { print "
"; print "\n"; - print '\n"; + print ''."\n"; if (count($projects) > 0) { @@ -682,15 +687,16 @@ if ($type == Categorie::TYPE_PROJECT) if ($permission) { print ""; - print img_delete($langs->trans("DeleteFromCat")).' '; - print $langs->trans("DeleteFromCat").""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink'); + print ""; } print "\n"; } } else { - print ''; + print ''; } print "
'.$langs->trans("Project")." (".count($projects).")
'.$langs->trans("Project").' '.count($projects).'
'.$langs->trans("ThisCategoryHasNoProject").'
'.$langs->trans("ThisCategoryHasNoProject").'
\n"; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 56e5e68b2f7..ab3a07f2192 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1392,6 +1392,8 @@ class ActionComm extends CommonObject */ public function build_exportfile($format, $type, $cachedelay, $filename, $filters) { + global $hookmanager; + // phpcs:enable global $conf,$langs,$dolibarr_main_url_root,$mysoc; @@ -1457,6 +1459,11 @@ class ActionComm extends CommonObject $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author"; // Link to get author of event for export $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc"; + + $parameters=array('filters' => $filters); + $reshook=$hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; + // We must filter on assignement table if ($filters['logint']) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; $sql.= " WHERE a.fk_action=c.id"; @@ -1502,7 +1509,13 @@ class ActionComm extends CommonObject elseif ($result < 0 || $condition == '=') $sql.= " AND ar.fk_element = 0"; } } + $sql.= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import + + $parameters=array('filters' => $filters); + $reshook=$hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; + $sql.= " ORDER by datep"; //print $sql;exit; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index cfe6ff817f7..c4ec266d454 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -7,7 +7,7 @@ * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2015-2019 Frédéric France + * Copyright (C) 2015-2019 Frédéric France * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -386,7 +386,7 @@ if ($object->id > 0) print ''; print '
'; print $langs->trans("CustomerRelativeDiscountShort"); - print ''; + print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) { print ''.img_edit($langs->trans("Modify")).''; @@ -400,7 +400,7 @@ if ($object->id > 0) print ''; print '"; + print '"; } elseif ($total>0) { - print '"; + print '"; } print "
'; print $langs->trans("CustomerAbsoluteDiscountShort"); - print ''; + print ''; if ($user->rights->societe->creer && !$user->societe_id > 0) { print ''.img_edit($langs->trans("Modify")).''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index e6fc5e95010..651d2c54ec7 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -159,12 +159,13 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) print '
'; print ''; print ''; - print ''; + print ''; if ($num > 0) { $i = 0; - while ($i < $num) + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); @@ -190,10 +191,13 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $i++; $total += $obj->total_ht; } - if ($total>0) + if ($num > $nbofloop) { - - print '"; + print '"; + } + elseif ($total>0) + { + print '"; } } else @@ -245,7 +249,8 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos if ($num > 0) { $i = 0; - while ($i < $num) + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); @@ -270,9 +275,13 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos $i++; $total += $obj->total_ht; } - if ($total>0) + if ($num > $nbofloop) + { + print '"; + } + elseif ($total>0) { - print '"; + print '"; } } else @@ -322,9 +331,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) if ($num > 0) { $i = 0; - while ($i < $num) + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { - $obj = $db->fetch_object($resql); print '"; + print '"; + } + elseif ($total>0) + { + print '"; } } else @@ -409,7 +421,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande if ($num > 0) { $i = 0; - while ($i < $num) + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); @@ -440,10 +453,13 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande $i++; $total += $obj->total_ttc; } - if ($total>0) + if ($num > $nbofloop) + { + print '"; + } + elseif ($total>0) { - - print '"; + print '"; } } else @@ -757,11 +773,11 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) } if ($num > $nbofloop) { - print '"; + print '"; } elseif ($total>0) { - print '"; + print '"; } print "
'.$langs->trans("ProposalsDraft").($num?' '.$num.'':'').'
'.$langs->trans("ProposalsDraft").' '.$num.'
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("Total").''.price($total)."
'; $orderstatic->id=$obj->rowid; @@ -353,10 +362,13 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $i++; $total += $obj->total_ttc; } - if ($total>0) + if ($num > $nbofloop) { - - print '
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("Total").''.price($total)."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'.$langs->trans("Total")."".price($total)." 
"; print "

"; @@ -861,11 +877,11 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } if ($num > $nbofloop) { - print '
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'.$langs->trans("Total")."".price($total)." 
"; print "
"; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 44c05629744..9a296def86b 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -790,7 +790,7 @@ if (empty($reshook)) // Go back to draft if ($action == 'modif' && $usercancreate) { - $object->set_draft($user); + $object->setDraft($user); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 9145b8eb151..d9fe5ccaf1a 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -593,7 +593,7 @@ class Proposals extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->propal->set_draft(DolibarrApiAccess::$user); + $result = $this->propal->setDraft(DolibarrApiAccess::$user); if ($result == 0) { throw new RestException(304, 'Nothing done. May be object is already draft'); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index e0ad01a453b..fd9187afb9c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2605,7 +2605,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function set_draft($user, $notrigger = 0) + public function setDraft($user, $notrigger = 0) { // phpcs:enable $error=0; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 24bd5fb1abb..813b91cca0a 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -129,7 +129,7 @@ elseif ($action == 'deletecontact' && $user->rights->propale->creer) } } /* -else if ($action == 'setaddress' && $user->rights->propale->creer) +elseif ($action == 'setaddress' && $user->rights->propale->creer) { $result=$object->setDeliveryAddress($_POST['fk_address']); if ($result < 0) dol_print_error($db,$object->error); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 2bc710394bb..e69dbbc8b6c 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -172,16 +172,18 @@ if (! empty($conf->propal->enabled)) $resql=$db->query($sql); if ($resql) { - print '
'; - print ''; - print ''; - print ''; - $langs->load("propal"); $num = $db->num_rows($resql); if ($num) { + print '
'; + print '
'.$langs->trans("DraftPropals").'
'; + print ''; + $langs->load("propal"); + print ''; + $i = 0; - while ($i < $num) + $nbofloop=min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD)?500:$conf->global->MAIN_MAXLIST_OVERLOAD)); + while ($i < $nbofloop) { $obj = $db->fetch_object($resql); print ''; @@ -199,9 +201,17 @@ if (! empty($conf->propal->enabled)) print ''; $i++; } + if ($num > $nbofloop) + { + print '"; + } + elseif ($total>0) + { + print '"; + } + print "
'.$langs->trans("DraftPropals").' '.$num.'
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total").''.price($total)."
"; + print "

"; } - print "
"; - print "
"; } } @@ -365,11 +375,11 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) } if ($num > $nbofloop) { - print ''.$langs->trans("XMoreLines", ($num - $nbofloop)).""; + print ''.$langs->trans("XMoreLines", ($num - $nbofloop)).""; } elseif ($total>0) { - print ''.$langs->trans("Total")."".price($total)." "; + print ''.$langs->trans("Total")."".price($total)." "; } print ""; print "
"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 65dba5049f4..f85870bd6f1 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1219,7 +1219,7 @@ if (empty($reshook)) } if (! $error) { - $result = $object->set_draft($user, $idwarehouse); + $result = $object->setDraft($user, $idwarehouse); if ($result >= 0) { // Define output language diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index ca7823a6ac1..27b55f9e57f 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -770,7 +770,7 @@ class Orders extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->commande->set_draft(DolibarrApiAccess::$user, $idwarehouse); + $result = $this->commande->setDraft(DolibarrApiAccess::$user, $idwarehouse); if ($result == 0) { throw new RestException(304, 'Nothing done. May be object is already closed'); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 390e0001594..a92bfe23eb8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -479,7 +479,7 @@ class Commande extends CommonOrder * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @return int <0 if KO, >0 if OK */ - public function set_draft($user, $idwarehouse = -1) + public function setDraft($user, $idwarehouse = -1) { //phpcs:enable global $conf,$langs; @@ -1635,7 +1635,7 @@ class Commande extends CommonOrder $sql.= ', c.date_livraison'; $sql.= ', c.fk_shipping_method'; $sql.= ', c.fk_warehouse'; - $sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; + $sql.= ', c.fk_projet as fk_project, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as billed'; $sql.= ', c.note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.last_main_doc, c.fk_delivery_address, c.extraparams'; $sql.= ', c.fk_incoterms, c.location_incoterms'; $sql.= ", c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc"; @@ -1696,7 +1696,7 @@ class Commande extends CommonOrder $this->note = $obj->note_private; // deprecated $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_project; $this->modelpdf = $obj->model_pdf; $this->last_main_doc = $obj->last_main_doc; $this->mode_reglement_id = $obj->fk_mode_reglement; @@ -3466,7 +3466,7 @@ class Commande extends CommonOrder $statusType=''; $mode = 0; } - + return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 73da3525a14..f95b9fcf40a 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -107,7 +107,7 @@ elseif ($action == 'deletecontact' && $user->rights->commande->creer) } } /* -else if ($action == 'setaddress' && $user->rights->commande->creer) +elseif ($action == 'setaddress' && $user->rights->commande->creer) { $object->fetch($id); $result=$object->setDeliveryAddress($_POST['fk_address']); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index ece5a6580de..68354d1961f 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; @@ -374,6 +375,7 @@ $paymentstatic=new Paiement($db); $paymentsupplierstatic=new PaiementFourn($db); $paymentvatstatic=new TVA($db); $paymentsalstatic=new PaymentSalary($db); +$paymentvariousstatic=new PaymentVarious($db); $donstatic=new Don($db); $paymentexpensereportstatic=new PaymentExpenseReport($db); $bankstatic=new Account($db); @@ -1153,13 +1155,13 @@ if ($resql) if ($links[$key]['type']=='payment') { $paymentstatic->id=$links[$key]['url_id']; - $paymentstatic->ref=$links[$key]['url_id']; + $paymentstatic->ref=$links[$key]['url_id']; // FIXME This is id, not ref of payment print ' '.$paymentstatic->getNomUrl(2); } elseif ($links[$key]['type']=='payment_supplier') { $paymentsupplierstatic->id=$links[$key]['url_id']; - $paymentsupplierstatic->ref=$links[$key]['url_id']; + $paymentsupplierstatic->ref=$links[$key]['url_id']; // FIXME This is id, not ref of payment print ' '.$paymentsupplierstatic->getNomUrl(2); } elseif ($links[$key]['type']=='payment_sc') @@ -1199,6 +1201,12 @@ if ($resql) $paymentexpensereportstatic->ref=$links[$key]['url_id']; print ' '.$paymentexpensereportstatic->getNomUrl(2); } + elseif ($links[$key]['type']=='payment_various') + { + $paymentvariousstatic->id=$links[$key]['url_id']; + $paymentvariousstatic->ref=$links[$key]['url_id']; + print ' '.$paymentvariousstatic->getNomUrl(2); + } elseif ($links[$key]['type']=='banktransfert') { // Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail. diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e3fea0200dc..daf090483c3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -621,7 +621,7 @@ if (empty($reshook)) { if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_EDITED) || ($resteapayer == $object->total_ttc && empty($object->paye))) { - $result=$object->set_draft($user, $idwarehouse); + $result=$object->setDraft($user, $idwarehouse); if ($result<0) setEventMessages($object->error, $object->errors, 'errors'); // Define output language @@ -1320,6 +1320,8 @@ if (empty($reshook)) foreach ($amountdeposit as $tva => $amount) { + if (empty($amount)) continue; + $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); $descline = $langs->trans('Deposit'); //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index d68c3d40338..bf7a102ffeb 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -745,7 +745,7 @@ class Invoices extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->invoice->set_draft(DolibarrApiAccess::$user, $idwarehouse); + $result = $this->invoice->setDraft(DolibarrApiAccess::$user, $idwarehouse); if ($result == 0) { throw new RestException(304, 'Nothing done.'); } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 9e36ceb646d..0d32c25bc5a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -381,7 +381,7 @@ class FactureRec extends CommonInvoice $sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.note_private, f.note_public, f.fk_user_author'; $sql.= ', f.modelpdf'; - $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet'; + $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; $sql.= ', f.fk_account'; $sql.= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; $sql.= ', f.generate_pdf'; @@ -438,7 +438,7 @@ class FactureRec extends CommonInvoice $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement_libelle; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_project; $this->fk_account = $obj->fk_account; $this->fk_facture_source = $obj->fk_facture_source; $this->note_private = $obj->note_private; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c48976c2153..6076cbb6232 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1321,7 +1321,7 @@ class Facture extends CommonInvoice $sql.= ', f.tms as datem'; $sql.= ', f.note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf, f.last_main_doc'; $sql.= ', f.fk_facture_source'; - $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams'; + $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project, f.extraparams'; $sql.= ', f.situation_cycle_ref, f.situation_counter, f.situation_final'; $sql.= ', f.fk_account'; $sql.= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; @@ -1386,7 +1386,7 @@ class Facture extends CommonInvoice $this->cond_reglement = $obj->cond_reglement_libelle; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; $this->fk_account = ($obj->fk_account>0)?$obj->fk_account:null; - $this->fk_project = $obj->fk_projet; + $this->fk_project = $obj->fk_project; $this->fk_facture_source = $obj->fk_facture_source; $this->note = $obj->note_private; // deprecated $this->note_private = $obj->note_private; @@ -2537,7 +2537,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - public function set_draft($user, $idwarehouse = -1) + public function setDraft($user, $idwarehouse = -1) { // phpcs:enable global $conf,$langs; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 600c4f7b57a..39978cd82d1 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -687,14 +687,14 @@ if ($resql) if (! empty($arrayfields['f.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } // Ref customer if (! empty($arrayfields['f.ref_client']['checked'])) { print ''; - print ''; + print ''; print ''; } // Type @@ -737,22 +737,22 @@ if ($resql) // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) print ''; // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) print ''; // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } // Country @@ -780,35 +780,35 @@ if ($resql) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['f.total_vat']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['f.total_localtax1']['checked'])) { // Localtax1 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['f.total_localtax2']['checked'])) { // Localtax2 print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['f.total_ttc']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['dynamount_payed']['checked'])) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 13b04854b9c..8b4bb12006b 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1180,7 +1180,7 @@ class Paiement extends CommonObject $result=''; $label = ''.$langs->trans("ShowPayment").'
'; $label.= ''.$langs->trans("Ref").': '.$this->ref; - $label.= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); + if ($this->datepaye ? $this->datepaye : $this->date) $label.= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); if ($mode == 'withlistofinvoices') { $arraybill = $this->getBillsArray(); diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 59984ee444c..317531884c0 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -288,13 +288,13 @@ elseif ($modecompta=="BOOKKEEPING") $j=1; $sommes = array(); $totPerAccount = array(); - if (!is_array($cats) && $cats<0) { - setEventMessages(null,$AccCat->errors,'errors'); + if (! is_array($cats) && $cats < 0) { + setEventMessages(null, $AccCat->errors, 'errors'); } elseif (is_array($cats) && count($cats)>0) { - foreach ($cats as $cat) // Loop on each group - { - if (!empty($cat['category_type'])) // category calculed - { + foreach ($cats as $cat) { + // Loop on each group + if (!empty($cat['category_type'])) { + // category calculed // When we enter here, $sommes was filled by group of accounts $formula = $cat['formula']; @@ -315,7 +315,6 @@ elseif ($modecompta=="BOOKKEEPING") $vars[$code] = $det['NP']; } - $result = strtr($formula, $vars); //var_dump($result); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index b1f99275c93..55a94d685cc 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -694,16 +694,16 @@ class Tva extends CommonObject if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result=''; - $label=$langs->trans("ShowVatPayment").': '.$this->ref; + + $label = '' . $langs->trans("ShowVatPayment") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; $url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id; $linkclose=''; if (empty($notooltip)) { - - - if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label=$langs->trans("ShowMyObject"); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 4f0022a7796..1b638849538 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1911,21 +1911,21 @@ else // Si pas encore active if (! $objp->date_debut_reelle) { print $langs->trans("DateStartReal").': '; - if ($objp->date_debut_reelle) print dol_print_date($objp->date_debut_reelle, 'day'); + if ($objp->date_debut_reelle) print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); else print $langs->trans("ContractStatusNotRunning"); } // Si active et en cours if ($objp->date_debut_reelle && ! $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle, 'day'); + print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); } // Si desactive if ($objp->date_debut_reelle && $objp->date_fin_reelle) { print $langs->trans("DateStartReal").': '; - print dol_print_date($objp->date_debut_reelle, 'day'); + print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); print '  -  '; print $langs->trans("DateEndReal").': '; - print dol_print_date($objp->date_fin_reelle, 'day'); + print dol_print_date($db->jdate($objp->date_fin_reelle), 'day'); } if (! empty($objp->comment)) print "  -  ".$objp->comment; print ''; diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php new file mode 100644 index 00000000000..0e37d830ef8 --- /dev/null +++ b/htdocs/core/boxes/box_birthdays.php @@ -0,0 +1,162 @@ + + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France + * + * 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/core/boxes/box_birthdays.php + * \ingroup user + * \brief Box for user birthdays + */ + +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show user birthdays + */ +class box_birthdays extends ModeleBoxes +{ + public $boxcode="birthdays"; + public $boximg="object_user"; + public $boxlabel="BoxBirthdays"; + public $depends = array("user"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $enabled = 1; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + global $conf, $user; + + $this->db = $db; + + $this->hidden = ! ($user->rights->user->user->lire && empty($user->socid)); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 20) + { + global $user, $langs, $db, $conf; + $langs->load("boxes"); + + $this->max=$max; + + include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $userstatic=new User($db); + + $this->info_box_head = array('text' => $langs->trans("BoxTitleUserBirthdaysOfMonth")); + + if ($user->rights->user->user->lire) + { + $sql = "SELECT u.rowid, u.firstname, u.lastname"; + $sql.= ", u.birth"; + $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; + $sql.= " WHERE u.entity IN (".getEntity('user').")"; + $sql.= " AND MONTH(u.birth) = ".date('m'); + $sql.= " ORDER BY u.birth ASC"; + $sql.= $db->plimit($max, 0); + + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + + $line = 0; + while ($line < $num) + { + $objp = $db->fetch_object($result); + $userstatic->id = $objp->rowid; + $userstatic->firstname = $objp->firstname; + $userstatic->lastname = $objp->lastname; + $userstatic->email = $objp->email; + $dateb=$db->jdate($objp->birth); + $age = date('Y', dol_now()) - date('Y', $dateb); + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $userstatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => dol_print_date($dateb, "day") . ' - ' . $age . ' ' . $langs->trans('DurationYears') + ); + + /*$this->info_box_contents[$line][] = array( + 'td' => 'class="right" width="18"', + 'text' => $userstatic->LibStatut($objp->status, 3) + );*/ + + $line++; + } + + if ($num==0) $this->info_box_contents[$line][0] = array('td' => 'class="center"','text'=>$langs->trans("NoRecordedUsers")); + + $db->free($result); + } + else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql) + ); + } + } + else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover opacitymedium left"', + 'text' => $langs->trans("ReadPermissionNotAllowed") + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index d1c85cb2044..0fe5c66d532 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -128,10 +128,6 @@ class box_graph_product_distribution extends ModeleBoxes ); - $paramtitle=$langs->transnoentitiesnoconv("Products").'/'.$langs->transnoentitiesnoconv("Services"); - if (empty($conf->produit->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Services"); - if (empty($conf->service->enabled)) $paramtitle=$langs->transnoentitiesnoconv("Products"); - $socid=empty($user->societe_id)?0:$user->societe_id; $userid=0; // No filter on user creation @@ -190,7 +186,7 @@ class box_graph_product_distribution extends ModeleBoxes $px1->SetCssPrefix("cssboxes"); //$px1->mode='depth'; $px1->SetType(array('pie')); - $px1->SetTitle($langs->trans("BoxProductDistributionFor", $paramtitle, $langs->transnoentitiesnoconv("Invoices"))); + $px1->SetTitle($langs->trans("ForObject", $langs->transnoentitiesnoconv("Invoices"))); $px1->combine = 0.05; $px1->draw($filenamenb, $fileurlnb); @@ -250,7 +246,7 @@ class box_graph_product_distribution extends ModeleBoxes $px2->SetCssPrefix("cssboxes"); //$px2->mode='depth'; $px2->SetType(array('pie')); - $px2->SetTitle($langs->trans("BoxProductDistributionFor", $paramtitle, $langs->transnoentitiesnoconv("Proposals"))); + $px2->SetTitle($langs->trans("ForObject", $langs->transnoentitiesnoconv("Proposals"))); $px2->combine = 0.05; $px2->draw($filenamenb, $fileurlnb); @@ -311,7 +307,7 @@ class box_graph_product_distribution extends ModeleBoxes $px3->SetCssPrefix("cssboxes"); //$px3->mode='depth'; $px3->SetType(array('pie')); - $px3->SetTitle($langs->trans("BoxProductDistributionFor", $paramtitle, $langs->transnoentitiesnoconv("Orders"))); + $px3->SetTitle($langs->trans("ForObject", $langs->transnoentitiesnoconv("Orders"))); $px3->combine = 0.05; $px3->draw($filenamenb, $fileurlnb); diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 502ba924513..1bf7a4eb9db 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -1,5 +1,5 @@ * * 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 diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 8ea15b31938..6e939a6278c 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -472,26 +472,26 @@ abstract class CommonInvoice extends CommonObject $statusType='status0'; $prefix='Short'; if (! $paye){ - if ($status == 0){ + if ($status == 0) { $labelstatut = $langs->trans('BillStatusDraft'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusDraft'); } - elseif (($status == 3 || $status == 2) && $alreadypaid <= 0){ + elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) { $labelstatut = $langs->trans('BillStatusClosedUnpaid'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); $statusType='status5'; } - elseif (($status == 3 || $status == 2) && $alreadypaid > 0){ + elseif (($status == 3 || $status == 2) && $alreadypaid > 0) { $labelstatut = $langs->trans('BillStatusClosedPaidPartially'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); $statusType='status9'; } - elseif ($alreadypaid <= 0){ + elseif ($alreadypaid <= 0) { $labelstatut = $langs->trans('BillStatusNotPaid'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusNotPaid'); $statusType='status1'; } - else{ + else { $labelstatut = $langs->trans('BillStatusStarted'); $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusStarted'); $statusType='status3'; @@ -500,7 +500,7 @@ abstract class CommonInvoice extends CommonObject else { $statusType='status6'; - + if ($type == self::TYPE_CREDIT_NOTE){ $labelstatut = $langs->trans('BillStatusPaidBackOrConverted'); // credit note $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note @@ -514,8 +514,8 @@ abstract class CommonInvoice extends CommonObject $labelstatutShort = $langs->trans('Bill'.$prefix.'StatusPaid'); } } - - + + return dolGetStatus($labelstatut, $labelstatutShort, '', $statusType, $mode); } @@ -525,7 +525,7 @@ abstract class CommonInvoice extends CommonObject * conditions de reglements de la facture et date de facturation. * * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. - * @return date Date limite de reglement si ok, <0 si ko + * @return integer Date limite de reglement si ok, <0 si ko */ public function calculate_date_lim_reglement($cond_reglement = 0) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73002dfceb4..7b83dce5394 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5373,7 +5373,7 @@ abstract class CommonObject * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @param string|int $morecss Value for css to define style/length of field. May also be a numeric. + * @param string|int $morecss Value for css to define style/length of field. May also be a numeric. * @return string */ public function showInputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = 0) @@ -5427,7 +5427,7 @@ abstract class CommonObject $langfile=$this->fields[$key]['langfile']; $list=$this->fields[$key]['list']; - $hidden=abs($this->fields[$key]['visible'])!=1?1:0; + $hidden=(in_array(abs($this->fields[$key]['visible']), array(0,2)) ? 1 : 0); $objectid = $this->id; @@ -5439,12 +5439,12 @@ abstract class CommonObject } - // Use in priority showsize from parameters, then $val['css'] then autodefine + // Set value of $morecss. For this, we use in priority showsize from parameters, then $val['css'] then autodefine if (empty($morecss) && ! empty($val['css'])) { - $showsize = $val['css']; + $morecss = $val['css']; } - if (empty($morecss)) + elseif (empty($morecss)) { if ($type == 'date') { @@ -5500,6 +5500,10 @@ abstract class CommonObject $newsize=$tmp[0]; $out=''; } + elseif (in_array($type, array('real'))) + { + $out=''; + } elseif (preg_match('/varchar/', $type)) { $out=''; @@ -5939,14 +5943,14 @@ abstract class CommonObject if(! empty($value)) { foreach($value as $option) { $out.= ' '; - $out.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', $option, $moreparam, '', '', $showsize).'
'; + $out.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', $option, $moreparam, '', '', $morecss).'
'; } } $out.= ''; $newInput = ' '; - $newInput.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', '', $moreparam, '', '', $showsize).'
'; + $newInput.= $this->showInputField($newval, $keyprefix.$key.$keysuffix.'[]', '', $moreparam, '', '', $morecss).'
'; if(! empty($conf->use_javascript_ajax)) { $out.= ' @@ -5983,10 +5987,10 @@ abstract class CommonObject * @param string $moreparam To add more parametes on html input tag * @param string $keysuffix Prefix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add into name and id of field (can be used to avoid duplicate names) - * @param mixed $showsize Value for css to define size. May also be a numeric. + * @param mixed $morecss Value for css to define size. May also be a numeric. * @return string */ - public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $showsize = 0) + public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '') { global $conf,$langs,$form; @@ -6037,45 +6041,41 @@ abstract class CommonObject $value = dol_eval($computed, 1, 0); } - if (empty($showsize)) + if (empty($morecss)) { if ($type == 'date') { - //$showsize=10; - $showsize = 'minwidth100imp'; + $morecss = 'minwidth100imp'; } elseif ($type == 'datetime') { - //$showsize=19; - $showsize = 'minwidth200imp'; + $morecss = 'minwidth200imp'; } elseif (in_array($type, array('int','double','price'))) { - //$showsize=10; - $showsize = 'maxwidth75'; + $morecss = 'maxwidth75'; } elseif ($type == 'url') { - $showsize='minwidth400'; + $morecss='minwidth400'; } elseif ($type == 'boolean') { - $showsize=''; + $morecss=''; } else { if (round($size) < 12) { - $showsize = 'minwidth100'; + $morecss = 'minwidth100'; } elseif (round($size) <= 48) { - $showsize = 'minwidth200'; + $morecss = 'minwidth200'; } else { - //$showsize=48; - $showsize = 'minwidth400'; + $morecss = 'minwidth400'; } } } diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 0e3987da516..861d7f737bb 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -93,29 +93,22 @@ class CUnits // extends CommonObject if (isset($this->unit_type)) $this->active=trim($this->unit_type); if (isset($this->active)) $this->active=trim($this->active); - - // Check parameters // Put here code to add control on parameters values // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_units("; - $sql.= "rowid,"; $sql.= "code,"; $sql.= "label,"; $sql.= "short_label,"; $sql.= "unit_type"; - - $sql.= ") VALUES ("; - $sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; $sql.= " ".(! isset($this->short_label)?'NULL':"'".$this->db->escape($this->short_label)."'").","; $sql.= " ".(! isset($this->unit_type)?'NULL':"'".$this->db->escape($this->unit_type)."'"); - $sql.= ")"; $this->db->begin(); @@ -187,7 +180,6 @@ class CUnits // extends CommonObject if ($unit_type) $sql_where[]= " t.unit_type = '".$this->db->escape($unit_type)."'"; if ($code) $sql_where[]= " t.code = '".$this->db->escape($code)."'"; if ($short_label) $sql_where[]= " t.short_label = '".$this->db->escape($short_label)."'"; - if (count($sql_where)>0) { $sql.=' WHERE '. implode(' AND ', $sql_where); } @@ -322,7 +314,6 @@ class CUnits // extends CommonObject if (isset($this->unit_type)) $this->libelle=trim($this->unit_type); if (isset($this->active)) $this->active=trim($this->active); - // Check parameters // Put here code to add control on parameters values diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e76e7d9cf9..3cb5cc6ecfa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2636,6 +2636,7 @@ class Form $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql.= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql.= " pfp.supplier_reputation"; + if (! empty($conf->barcode->enabled)) $sql.= " ,pfp.barcode"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; @@ -2660,7 +2661,10 @@ class Form $i++; } if (count($scrit) > 1) $sql.=")"; - if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + if (! empty($conf->barcode->enabled)){ + $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + $sql.= " OR pfp.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + } $sql.=')'; } $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; @@ -2780,6 +2784,11 @@ class Form $opt .= " - ".dol_trunc($objp->name, 8); $outval.=" - ".dol_trunc($objp->name, 8); } + if (! empty($conf->barcode->enabled) && !empty($objp->barcode)) + { + $opt .= " - ".$objp->barcode; + $outval.=" - ".$objp->barcode; + } if ($objp->supplier_reputation) { //TODO dictionary @@ -3796,7 +3805,7 @@ class Form * @param int $excludeafterid Exclude all categories after this leaf in category tree. * @param int $outputmode 0=HTML select string, 1=Array * @return string - * @see select_categories + * @see select_categories() */ public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $excludeafterid = 0, $outputmode = 0) { @@ -3907,7 +3916,7 @@ class Form * print '});'."\n"; * print ''."\n"; * - * @param string $page Url of page to call if confirmation is OK. Can contains paramaters (param 'action' and 'confirm' will be reformated) + * @param string $page Url of page to call if confirmation is OK. Can contains parameters (param 'action' and 'confirm' will be reformated) * @param string $title Title * @param string $question Question * @param string $action Action diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1ea48c90091..5f6958ae206 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -152,7 +152,7 @@ class FormFile $out .= (!empty($accept)?' accept="'.$accept.'"':' accept=""'); $out .= '>'; $out .= ' '; - $out .= 'trans("Upload").'"'; $out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled':''); $out .= '>'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index b643f1dfcb9..31eeb08e0a6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -78,7 +78,7 @@ class FormMail extends Form /** * @var int * @deprecated Fill withto with array before calling method. - * @see withto + * @see $withto */ public $withtosocid; @@ -1056,12 +1056,12 @@ class FormMail extends Form //if (! $this->errorstomail) $this->errorstomail=$this->frommail; $errorstomail = (! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); if ($this->witherrorstoreadonly) { - $out.= ''.$langs->trans("MailErrorsTo").''; - $out = ''; + $out= ''.$langs->trans("MailErrorsTo").''; + $out.= ''; $out.= $errorstomail; $out.= "\n"; } else { - $out.= ''.$langs->trans("MailErrorsTo").''; + $out= ''.$langs->trans("MailErrorsTo").''; $out.= ''; $out.= "\n"; } @@ -1317,7 +1317,7 @@ class FormMail extends Form * @param CommonObject $object Object to use * @param Translate $outputlangs Object lang * @return void - * @see getCommonSubstitutionArray + * @see getCommonSubstitutionArray() */ public function setSubstitFromObject($object, $outputlangs) { diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index d3f8e55832a..1e596209cdb 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -572,7 +572,7 @@ class Utils */ public function generateDoc($module) { - global $conf, $langs; + global $conf, $langs, $user; global $dirins; $error = 0; @@ -634,6 +634,19 @@ class Utils return -1; } + // Copy some files into temp directory, so instruction include::ChangeLog.md[] will works inside the asciidoc file. + dol_copy($dirofmodule.'/README.md', $dirofmoduletmp.'/README.md', 0, 1); + dol_copy($dirofmodule.'/ChangeLog.md', $dirofmoduletmp.'/ChangeLog.md', 0, 1); + + // Replace into README.md and ChangeLog.md (in case they are included into documentation with tag __README__ or __CHANGELOG__) + $arrayreplacement=array(); + $arrayreplacement['/^#\s.*/m']=''; // Remove first level of title into .md files + $arrayreplacement['/^#/m']='##'; // Add on # to increase level + + dolReplaceInFile($dirofmoduletmp.'/README.md', $arrayreplacement, '', 0, 0, 1); + dolReplaceInFile($dirofmoduletmp.'/ChangeLog.md', $arrayreplacement, '', 0, 0, 1); + + $destfile=$dirofmoduletmp.'/'.$FILENAMEASCII; $fhandle = fopen($destfile, 'w+'); @@ -666,25 +679,36 @@ class Utils $i++; } - fwrite($fhandle, "\n\n\n== DATA SPECIFICATIONS...\n\n"); - - // TODO - fwrite($fhandle, "TODO..."); - - - fwrite($fhandle, "\n\n\n== CHANGELOG...\n\n"); - - // TODO - fwrite($fhandle, "TODO..."); - - - fclose($fhandle); - } - // Copy some files into temp directory - dol_copy($dirofmodule.'/README.md', $dirofmoduletmp.'/README.md', 0, 1); - dol_copy($dirofmodule.'/ChangeLog.md', $dirofmoduletmp.'/ChangeLog.md', 0, 1); + $contentreadme=file_get_contents($dirofmoduletmp.'/README.md'); + $contentchangelog=file_get_contents($dirofmoduletmp.'/ChangeLog.md'); + + include DOL_DOCUMENT_ROOT.'/core/lib/parsemd.lib.php'; + + //var_dump($phpfileval['fullname']); + $arrayreplacement=array( + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '__MYCOMPANY_NAME__'=>$mysoc->name, + '__KEYWORDS__'=>$modulename, + '__USER_FULLNAME__'=>$user->getFullName($langs), + '__USER_EMAIL__'=>$user->email, + '__YYYY-MM-DD__'=>dol_print_date($now, 'dayrfc'), + '---Put here your own copyright and developer email---'=>dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':''), + '__DATA_SPECIFICATION__'=>'Not yet available', + '__README__'=>dolMd2Asciidoc($contentreadme), + '__CHANGELOG__'=>dolMd2Asciidoc($contentchangelog), + ); + + dolReplaceInFile($destfile, $arrayreplacement); + } // Launch doc generation $currentdir = getcwd(); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f1a06b46262..a96e63a4f43 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -375,8 +375,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = { global $conf; - // select2 disabled for smartphones with standard browser. - // TODO With select2 v4, it seems ok, except that responsive style on table become crazy when scrolling at end of array) + // select2 can be disabled for smartphones if (! empty($conf->browser->layout) && $conf->browser->layout == 'phone' && ! empty($conf->global->MAIN_DISALLOW_SELECT2_WITH_SMARTPHONE)) return ''; if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 94707467166..bcc8902f79c 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -800,15 +800,15 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel } print ''; // Opp status - print ''; + print ''; if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code); print ''; // Opp percent - print ''; + print ''; if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%'; print ''; // Status - print ''.$projecttmp->getLibStatut(5).''; + print ''.$projecttmp->getLibStatut(5).''; print ''; } @@ -887,7 +887,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), - 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'align'=>'center'), + 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'class'=>'center'), ); // Extra fields if (is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) @@ -1222,21 +1222,30 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $numaction = 0 ; $now=dol_now('tzuser'); + // Open DSI -- Fix order by -- Begin + $sortfield_list = explode(',', $sortfield); + $sortfield_label_list = array('a.id' => 'id', 'a.datep' => 'dp', 'a.percent' => 'percent'); + $sortfield_new_list = array(); + foreach ($sortfield_list as $sortfield_value) { + $sortfield_new_list[] = $sortfield_label_list[trim($sortfield_value)]; + } + $sortfield_new = implode(',', $sortfield_new_list); + if (! empty($conf->agenda->enabled)) { // Recherche histo sur actioncomm - if (is_object($objcon) && $objcon->id) { - $sql = "SELECT DISTINCT a.id, a.label,"; - } - else - { - $sql = "SELECT a.id, a.label,"; - } - $sql.= " a.datep as dp,"; + if (is_object($objcon) && $objcon->id) { + $sql = "SELECT DISTINCT a.id, a.label as label,"; + } + else + { + $sql = "SELECT a.id, a.label as label,"; + } + $sql.= " a.datep as dp,"; $sql.= " a.datep2 as dp2,"; - $sql.= " a.note, a.percent,"; + $sql.= " a.percent as percent, 'action' as type,"; $sql.= " a.fk_element, a.elementtype,"; - $sql.= " a.fk_user_author, a.fk_contact,"; + $sql.= " a.fk_contact,"; $sql.= " c.code as acode, c.libelle as alabel, c.picto as apicto,"; $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= ", sp.lastname, sp.firstname"; @@ -1248,17 +1257,19 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id"; + $force_filter_contact = false; if (is_object($objcon) && $objcon->id) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql.= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . $objcon->id; - } + $force_filter_contact = true; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; + $sql.= " AND r.element_type = '" . $db->escape($objcon->table_element) . "' AND r.fk_element = " . $objcon->id; + } - if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') { - $sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; - $sql.= " ON er.resource_type = 'dolresource'"; - $sql.= " AND er.element_id = a.id"; - $sql.= " AND er.resource_id = ".$filterobj->id; + $sql.= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; + $sql.= " ON er.resource_type = 'dolresource'"; + $sql.= " AND er.element_id = a.id"; + $sql.= " AND er.resource_id = ".$filterobj->id; } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m"; elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o"; @@ -1266,9 +1277,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o"; $sql.= " WHERE a.entity IN (".getEntity('agenda').")"; - if (is_object($objcon) && $objcon->id) { - $sql.= " AND a.fk_contact = ".$objcon->id; - } else { + if ($force_filter_contact === false) { if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id; elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') @@ -1316,69 +1325,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']); - - //TODO Add limit in nb of results - $sql.= $db->order($sortfield, $sortorder); - dol_syslog("company.lib::show_actions_done", LOG_DEBUG); - $resql=$db->query($sql); - if ($resql) - { - $i = 0 ; - $num = $db->num_rows($resql); - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $contactaction = new ActionComm($db); - $contactaction->id=$obj->id; - $result = $contactaction->fetchResources(); - if ($result<0) { - dol_print_error($db); - setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); - } - - //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; - //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; - $tododone=''; - if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone='todo'; - - $histo[$numaction]=array( - 'type'=>'action', - 'tododone'=>$tododone, - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->dp), - 'dateend'=>$db->jdate($obj->dp2), - 'note'=>$obj->label, - 'percent'=>$obj->percent, - - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo, - - 'contact_id'=>$obj->fk_contact, - 'socpeopleassigned' => $contactaction->socpeopleassigned, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, - 'fk_element'=>$obj->fk_element, - 'elementtype'=>$obj->elementtype, - // Type of event - 'acode'=>$obj->acode, - 'alabel'=>$obj->alabel, - 'libelle'=>$obj->alabel, // deprecated - 'apicto'=>$obj->apicto - ); - - $numaction++; - $i++; - } - } - else - { - dol_print_error($db); - } } // Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing. @@ -1387,52 +1333,108 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin { $langs->load("mails"); - $sql = "SELECT m.rowid as id, mc.date_envoi as da, m.titre as note, '100' as percentage,"; - $sql.= " 'AC_EMAILING' as acode,"; - $sql.= " u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action - $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u"; - $sql.= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email. - $sql.= " AND mc.statut = 1"; - $sql.= " AND u.rowid = m.fk_user_valid"; - $sql.= " AND mc.fk_mailing=m.rowid"; - $sql.= " ORDER BY mc.date_envoi DESC, m.rowid DESC"; + $sql2 = "SELECT m.rowid as id, m.titre as label, mc.date_envoi as dp, mc.date_envoi as dp2, '100' as percent, 'mailing' as type"; + $sql2.= ", '' as fk_element, '' as elementtype, '' as contact_id"; + $sql2.= ", 'AC_EMAILING' as acode, '' as alabel, '' as apicto"; + $sql2.= ", u.rowid as user_id, u.login as user_login, u.photo as user_photo, u.firstname as user_firstname, u.lastname as user_lastname"; // User that valid action + if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql2.= ", '' as lastname, '' as firstname"; + elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql2.= ", '' as lastname, '' as firstname"; + elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql2.= ", '' as ref"; + elseif (is_object($filterobj) && get_class($filterobj) == 'Product') $sql2.= ", '' as ref"; + elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql2.= ", '' as ref"; + $sql2.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u"; + $sql2.= " WHERE mc.email = '".$db->escape($objcon->email)."'"; // Search is done on email. + $sql2.= " AND mc.statut = 1"; + $sql2.= " AND u.rowid = m.fk_user_valid"; + $sql2.= " AND mc.fk_mailing=m.rowid"; + } - dol_syslog("company.lib::show_actions_done", LOG_DEBUG); - $resql=$db->query($sql); - if ($resql) + if (!empty($sql) && !empty($sql2)) { + $sql = $sql . " UNION " . $sql2; + } else if (empty($sql) && !empty($sql2)) { + $sql = $sql2; + } + //TODO Add limit in nb of results + $sql.= $db->order($sortfield_new, $sortorder); + dol_syslog("company.lib::show_actions_done", LOG_DEBUG); + $resql=$db->query($sql); + if ($resql) + { + $i = 0 ; + $num = $db->num_rows($resql); + + while ($i < $num) { - $i = 0 ; - $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + + if ($obj->type == 'action') { + $contactaction = new ActionComm($db); + $contactaction->id=$obj->id; + $result = $contactaction->fetchResources(); + if ($result<0) { + dol_print_error($db); + setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); + } + + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; + //elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; + $tododone=''; + if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone='todo'; - while ($i < $num) - { - $obj = $db->fetch_object($resql); $histo[$numaction]=array( - 'type'=>'mailing', - 'tododone'=>'done', - 'id'=>$obj->id, - 'datestart'=>$db->jdate($obj->da), - 'dateend'=>$db->jdate($obj->da), - 'note'=>$obj->note, - 'percent'=>$obj->percentage, - 'acode'=>$obj->acode, + 'type'=>$obj->type, + 'tododone'=>$tododone, + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'percent'=>$obj->percent, - 'userid'=>$obj->user_id, - 'login'=>$obj->user_login, - 'userfirstname'=>$obj->user_firstname, - 'userlastname'=>$obj->user_lastname, - 'userphoto'=>$obj->user_photo - ); - $numaction++; - $i++; + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo, + + 'contact_id'=>$obj->fk_contact, + 'socpeopleassigned' => $contactaction->socpeopleassigned, + 'lastname'=>$obj->lastname, + 'firstname'=>$obj->firstname, + 'fk_element'=>$obj->fk_element, + 'elementtype'=>$obj->elementtype, + // Type of event + 'acode'=>$obj->acode, + 'alabel'=>$obj->alabel, + 'libelle'=>$obj->alabel, // deprecated + 'apicto'=>$obj->apicto + ); + } else { + $histo[$numaction]=array( + 'type'=>$obj->type, + 'tododone'=>'done', + 'id'=>$obj->id, + 'datestart'=>$db->jdate($obj->dp), + 'dateend'=>$db->jdate($obj->dp2), + 'note'=>$obj->label, + 'percent'=>$obj->percent, + 'acode'=>$obj->acode, + + 'userid'=>$obj->user_id, + 'login'=>$obj->user_login, + 'userfirstname'=>$obj->user_firstname, + 'userlastname'=>$obj->user_lastname, + 'userphoto'=>$obj->user_photo + ); } - $db->free($resql); - } - else - { - dol_print_error($db); + + $numaction++; + $i++; } } + else + { + dol_print_error($db); + } if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email))) { diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index ef58497ccdd..e2c863cd2ba 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -64,7 +64,7 @@ function show_skin($fuser, $edit = 0) // Title print ''.$langs->trans("DefaultSkin").''; - print ''; + print ''; $url='http://ckeditor.com/addons/skins/all'; /*print ''; print $langs->trans('DownloadMoreSkins'); @@ -84,7 +84,7 @@ function show_skin($fuser, $edit = 0) // print ''; - print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; if (! empty($conf->stock->enabled)) { print ''; @@ -236,8 +236,8 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') if (! empty($conf->livraison_bon->enabled)) { print ''; - //print ''; - print ''; + //print ''; + print ''; } print "\n"; @@ -248,7 +248,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; // Sending id - print ''; @@ -324,16 +324,16 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print "\n"; } - //print ''; + //print ''; // Date creation - print ''; + print ''; // Date shipping creation - print ''; + print ''; // Qty shipped - print ''; + print ''; // Warehouse if (! empty($conf->stock->enabled)) @@ -403,13 +403,13 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') //print ''.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.''; print ''; // Qty received - //print ''; // Date shipping real - print ''; } diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index eacf0386eb5..34683e5b29f 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -171,7 +171,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print '   '; print $tab[$x]['title']; print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; - print '
'; + print ''; // Warning - print '\n"; // Planned Workload - print ''; // Progress declared % - print ''; // Time spent by everybody - print '\n"; // Time spent by user - print ''; @@ -1097,13 +1097,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print ''; // Note - print ''; // Warning - print '\n"; // Planned Workload - print ''; // Progress declared % - print ''; // Time spent by everybody - print '\n"; // Time spent by user - print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''; - print ''; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ''; + print ''; $plannedworkload=$objp->planned_workload; $total_plannedworkload+=$plannedworkload; if (! in_array('plannedworkload', $hiddenfields)) { - print ''; + print ''; } if (! in_array('declaredprogress', $hiddenfields)) { $declaredprogressworkload=$objp->declared_progess_workload; $total_declaredprogressworkload+=$declaredprogressworkload; - print ''; } } - print ''; + print ''; print "\n"; $total_task = $total_task + $objp->nb; @@ -1673,14 +1673,14 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print '"; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''; - print ''; + print ''; + print ''; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ''; - if (! in_array('plannedworkload', $hiddenfields)) print ''; - if (! in_array('declaredprogress', $hiddenfields)) print ''; + print ''; + if (! in_array('plannedworkload', $hiddenfields)) print ''; + if (! in_array('declaredprogress', $hiddenfields)) print ''; } print ''; print ''; @@ -1702,7 +1702,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print '
'; $i=0; foreach($dirskins as $dir) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ec7ca11ca69..b2c7edf4590 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -583,19 +583,20 @@ function dol_filemtime($pathoffile) /** * Make replacement of strings into a file. * - * @param string $srcfile Source file (can't be a directory) - * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) - * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. - * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' - * @param int $indexdatabase 1=index new file into database. - * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dol_copy() dolReplaceRegExInFile() + * @param string $srcfile Source file (can't be a directory) + * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) + * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. + * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' + * @param int $indexdatabase 1=index new file into database. + * @param int $arrayreplacementisregex 1=Array of replacement is regex + * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK + * @see dol_copy() */ -function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0) +function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0, $arrayreplacementisregex = 0) { global $conf; - dol_syslog("files.lib.php::dolReplaceInFile srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." indexdatabase=".$indexdatabase); + dol_syslog("files.lib.php::dolReplaceInFile srcfile=".$srcfile." destfile=".$destfile." newmask=".$newmask." indexdatabase=".$indexdatabase." arrayreplacementisregex=".$arrayreplacementisregex); if (empty($srcfile)) return -1; if (empty($destfile)) $destfile=$srcfile; @@ -626,7 +627,17 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask // Create $newpathoftmpdestfile from $newpathofsrcfile $content = file_get_contents($newpathofsrcfile, 'r'); - $content = make_substitutions($content, $arrayreplacement, null); + if (empty($arrayreplacementisregex)) + { + $content = make_substitutions($content, $arrayreplacement, null); + } + else + { + foreach ($arrayreplacement as $key => $value) + { + $content = preg_replace($key, $value, $content); + } + } file_put_contents($newpathoftmpdestfile, $content); @chmod($newpathoftmpdestfile, octdec($newmask)); @@ -650,21 +661,6 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask return 1; } -/** - * Make replacement of strings into a file. - * - * @param string $srcfile Source file (can't be a directory) - * @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...) - * @param string $destfile Destination file (can't be a directory). If empty, will be same than source file. - * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' - * @param int $indexdatabase Index new file into database. - * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dol_copy() dolReplaceInFile() - */ -function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0) -{ - // TODO -} /** * Copy a file to another file. diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8750b943685..a900cf98889 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -437,7 +437,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti } } - // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters) + // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable parameters) // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOMPANY_COUNTRY_ID__, __USER_ID__, ... // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) @@ -923,7 +923,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) * * @param string $stringtoescape String to escape * @param int $keepb 1=Preserve b tags (otherwise, remove them) - * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value) + * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value). Set to 1 when escaping for a '; print '
'; + print ''; /*if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject")); else if ($disabledtask) { @@ -1001,18 +1001,18 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print "'; + print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload, 'allhourmin'); else print '--:--'; print ''; + print ''; print $formother->select_percent($lines[$i]->progress, $lines[$i]->id . 'progress'); print ''; + print ''; // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user if ($lines[$i]->duration) { @@ -1024,7 +1024,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr print "'; + print ''; $tmptimespent=$taskstatic->getSummaryOfTimeSpent($fuser->id); if ($tmptimespent['total_duration']) print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); else print '--:--'; @@ -1047,7 +1047,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr } // Form to add new time - print ''; + print ''; $tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask); print $tableCell; print ''; + print ''; print ''; print ''; + print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('', $langs->trans("UserIsNotContactOfProject")); elseif ($disabledtask) { @@ -1291,18 +1291,18 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print "'; + print ''; if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload, 'allhourmin'); else print '--:--'; print ''; + print ''; print $formother->select_percent($lines[$i]->progress, $lines[$i]->id . 'progress'); print ''; + print ''; // $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consummed by user if ($lines[$i]->duration) { @@ -1314,7 +1314,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ print "'; + print ''; $tmptimespent=$taskstatic->getSummaryOfTimeSpent($fuser->id); if ($tmptimespent['total_duration']) print convertSecondToTime($tmptimespent['total_duration'], 'allhourmin'); else print '--:--'; @@ -1381,7 +1381,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } // Warning - print ''; + print ''; if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('', $langs->trans("UserIsNotContactOfProject")); elseif ($disabledtask) { @@ -1629,36 +1629,36 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks print ''; + print ''; if ($objp->opp_amount) print price($objp->opp_amount, 0, '', 1, -1, -1, $conf->currency); print ''; + print ''; $code = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code'); if ($code) print $langs->trans("OppStatus".$code); print ''.$objp->nb.''.$objp->nb.''.($plannedworkload?convertSecondToTime($plannedworkload):'').''.($plannedworkload?convertSecondToTime($plannedworkload):'').''; + print ''; //print $objp->planned_workload.'-'.$objp->declared_progess_workload."
"; print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload, 0).'%':''); print '
'.$projectstatic->getLibStatut(3).''.$projectstatic->getLibStatut(3).'
'.$langs->trans("Total")."'.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmountDesc"), 1).''.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmountDesc"), 1).''.$total_task.''.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload, 0).'%':'').''.$total_task.''.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload, 0).'%':'').'
'; print ''; print ''; - print '\n"; print '
'.$langs->trans("Year").''; + print ''; print "
'; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index da14436f749..8392b857061 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -451,13 +451,13 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand if ($feature == 'project') $feature='projet'; if ($feature == 'task') $feature='projet_task'; - $check = array('adherent','banque','don','user','usergroup','product','produit','service','produit|service','categorie','resource'); // Test on entity only (Objects with no link to company) + $check = array('adherent','banque','don','user','usergroup','product','produit','service','produit|service','categorie','resource','expensereport','holiday'); // Test on entity only (Objects with no link to company) $checksoc = array('societe'); // Test for societe object $checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...). $checkproject = array('projet','project'); // Test for project object $checktask = array('projet_task'); $nocheck = array('barcode','stock'); // No test - $checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...). + //$checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...). // If dbtablename not defined, we use same name for table than module name if (empty($dbtablename)) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index cc7d2c95115..97d8a318e5c 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -220,9 +220,9 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') //print '
'.$langs->trans("QtyOrdered").''.$langs->trans("SendingSheet").''.$langs->trans("Description").''.$langs->trans("DateCreation").''.$langs->trans("DateDeliveryPlanned").''.$langs->trans("QtyPreparedOrShipped").''.$langs->trans("DateCreation").''.$langs->trans("DateDeliveryPlanned").''.$langs->trans("QtyPreparedOrShipped").''.$langs->trans("Warehouse").''.$langs->trans("DeliveryOrder").''.$langs->trans("QtyReceived").''.$langs->trans("DeliveryDate").''.$langs->trans("QtyReceived").''.$langs->trans("DeliveryDate").'
'; + print ''; print ''.img_object($langs->trans("ShowSending"), 'sending').' '.$objp->exp_ref.''; print ''.$objp->qty_asked.''.$objp->qty_asked.''.dol_print_date($db->jdate($objp->date_creation), 'day').''.dol_print_date($db->jdate($objp->date_creation), 'day').''.dol_print_date($db->jdate($objp->date_delivery), 'day').''.dol_print_date($db->jdate($objp->date_delivery), 'day').''.$objp->qty_shipped.''.$objp->qty_shipped.''; + //print ''; // TODO No solution for the moment to link a line det of receipt with a line det of shipping, // so no way to know the qty received for this line of shipping. //print $langs->trans("FeatureNotYetAvailable"); //print ''; + print ''; print dol_print_date($receiving->date_delivery, 'day'); print ''; + print ''; print $tab[$x]['buttons']; print '
'; } @@ -207,7 +207,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print $tab[$x]['title']; print ''; print '  (mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' - fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; - print ''; + print ''; print $tab[$x]['buttons']; print ''; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index de85a573cab..532ff5dfb3d 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -343,14 +343,14 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print ''; print ''.$langs->trans("DefaultSkin").''; print ''.$conf->global->MAIN_THEME.''; - print ' '.$langs->trans("UsePersonalValue").''; + print ' '.$langs->trans("UsePersonalValue").''; print ' '; print ''; } else { print ''.$langs->trans("DefaultSkin").''; - print ''; + print ''; $url='https://www.dolistore.com/lang-en/4-skins'; if (preg_match('/fr/i', $langs->defaultlang)) $url='https://www.dolistore.com/fr/4-themes'; //if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes'; @@ -372,7 +372,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print ''; - print ''; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index f1d295802a9..a9dc2846ad6 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -83,9 +83,9 @@ class mod_task_universal extends ModeleNumRefTask // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 972bb94cb64..ddf856d5003 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -85,9 +85,9 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index 6f7d66f8ef3..84b35cb7771 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -60,8 +60,8 @@ class mod_reception_moonstone extends ModelNumRefReception $tooltip.=$langs->trans("GenericMaskCodes5"); $texte.= ''; - $texte.= ''; - $texte.= ''; + $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= '
'; + print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -857,7 +857,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -898,6 +898,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) // Use MAIN_OPTIMIZEFORTEXTBROWSER if ($foruserprofile) { + //$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); $default=$langs->trans('No'); print ''; print ''; @@ -918,14 +919,32 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) if (empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' ('.$langs->trans("ForcedByGlobalSetup").')'; } } - print '   ('.$langs->trans("Default").': '.yn(0).') '; + print '   ('.$langs->trans("Default").': '.$default.') '; print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORTEXTBROWSERDesc")); print ''; print ''; } else { - // TODO + /*var_dump($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); + $default=$langs->trans('No'); + print ''; + print ''; + print ''; + print ''; + */ } print '
'; $i=0; foreach($dirthemes as $dir) @@ -432,7 +432,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuDisableImages").''.($conf->global->THEME_TOPMENU_DISABLE_IMAGE?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -477,7 +477,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -524,7 +524,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -573,7 +573,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_VERMENU_BACK1:$langs->trans("Default")).'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -763,7 +763,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("TopMenuBackgroundColor").''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTLINK:$langs->trans("Default")).'conf->THEME_ELDY_TEXTLINK)?" checked":""); + print 'conf->THEME_ELDY_TEXTLINK)?" checked":""); print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; @@ -814,7 +814,7 @@ function show_theme($fuser, $edit = 0, $foruserprofile = false) print '
'.$langs->trans("HighlightLinesOnMouseHover").'global->THEME_ELDY_USE_HOVER?" checked":"").'> '.$langs->trans("UsePersonalValue").' '.$langs->trans("UsePersonalValue").''; print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '
'.$langs->trans("HighlightLinesOnMouseHover").'global->THEME_ELDY_USE_HOVER?" checked":"").'> '.$langs->trans("UsePersonalValue").' '.$langs->trans("UsePersonalValue").''; print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; print '
'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").'
'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").''; + if ($edit) + { + print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER, 1); + } + else + { + print yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); + } + print '   ('.$langs->trans("Default").': '.$default.') '; + print $form->textwithpicto('', $langs->trans("MAIN_OPTIMIZEFORTEXTBROWSERDesc")); + print ''; + print '
'; diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index 614f22cf998..65408d80863 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -275,7 +275,7 @@ - '; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index 55378e6b5fb..676b8e9b8bc 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -19,7 +19,7 @@ * \defgroup dav Module dav * \brief dav module descriptor. * - * \file htdocs/dav/core/modules/modDav.class.php + * \file htdocs/core/modules/modDav.class.php * \ingroup dav * \brief Description and activation file for module dav */ diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php new file mode 100644 index 00000000000..6592ecb5acf --- /dev/null +++ b/htdocs/core/modules/modDebugBar.class.php @@ -0,0 +1,134 @@ +. + */ + +/** + * \defgroup debugbar Debug bar + * \brief debugbar module descriptor. + * + * \file htdocs/core/modules/modDebugBar.class.php + * \ingroup debugbar + * \brief Description and activation file for module debugbar + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + + +/** + * Class to describe and enable module + */ +class modDebugBar extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + + $this->numero = 43; + + $this->rights_class = 'debugbar'; + + $this->family = "base"; + $this->module_position = '75'; + + // 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 = "A tool for developper adding a debug bar in your browser."; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or version + $this->version = 'dolibarr'; + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + $this->picto='technic'; + + $this->module_parts = array( + // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all' + 'hooks' => array( + 'data' => array( + 'main', + 'login', + ), + 'entity' => '0', + ), + // Set this to 1 if feature of module are opened to external users + 'moduleforexternal' => 0, + ); + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Dependencies + $this->depends = array(); // May be used for product or service or third party module + $this->requiredby = array(); + + // Config pages + $this->config_page_url = array("debugbar.php"); + + // Constants + // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',0), + // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0) ); + $this->const = array( + 0 => array('DEBUGBAR_LOGS_LINES_NUMBER', 'chaine', '100', 'Number of log lines to show in debug bar', 1) + ); + + // Boxes + $this->boxes = array(); + + // Permissions + $this->rights = array(); + + $this->rights[1][0] = 430; // id de la permission + $this->rights[1][1] = 'Use Debug Bar'; // libelle de la permission + $this->rights[1][2] = 'u'; // type de la permission (deprecie a ce jour) + $this->rights[1][3] = 1; // La permission est-elle une permission par defaut + $this->rights[1][4] = 'read'; + } + + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories. + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options = '') + { + // Permissions + $this->remove($options); + + $sql = array( + ); + + return $this->_init($sql, $options); + } + + /** + * Function called after module configuration. + * + * @return void + */ + public function loadSettings() + { + $this->addPermission("use", "UseDebugBar", "u"); + + $this->enableHooks(array( + 'main', + 'login' + )); + } +} diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index baf7f94d0f4..bf7b0c49896 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -78,6 +78,7 @@ class modUser extends DolibarrModules // Boxes $this->boxes = array( 0=>array('file'=>'box_lastlogin.php','enabledbydefaulton'=>'Home'), + 1=>array('file'=>'box_birthdays.php','enabledbydefaulton'=>'Home') ); // Permissions diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 19e74cf3c19..2f3114bfd09 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -82,9 +82,9 @@ class mod_payment_ant extends ModeleNumRefPayments // Parametrage du prefix $texte.= ''; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 97a00a14575..e7e20db532f 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -113,15 +113,15 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix customers $texte.= ''; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; // Parametrage du prefix suppliers $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= '
+ '; - $texte.= ''; + $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index 8c6fd9ebe97..9d1fa644c0a 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -82,8 +82,8 @@ class mod_holiday_immaculate extends ModelNumRefHolidays $tooltip.=$langs->trans("GenericMaskCodes5"); $texte.= ''; - $texte.= ''; - $texte.= ''; + $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= '
Date et signature

diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 25b98473238..db7b2febbb2 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -84,9 +84,9 @@ class mod_arctic extends ModeleNumRefFicheinter // Parametrage du prefix $texte.= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'  '.$form->textwithpicto('', $tooltip, 1, 1).' 
'; $texte.= ''; diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php index 2fc2e16d7fd..b8f00725858 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php @@ -83,9 +83,9 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder // Parametrage du prefix $texte.= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'
'; diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index f987d4d3b32..be8a9c3f362 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -83,9 +83,9 @@ class mod_project_universal extends ModeleNumRefProjects // Parametrage du prefix $texte.= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'   
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'  '.$form->textwithpicto('', $tooltip, 1, 1).' 
'; $texte.= ''; diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index f8d4f137048..4be4ea5d50e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -114,15 +114,15 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte.= '  '; + $texte.= '  '; $texte.= ''; // Parametrage du prefix suppliers $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 7f85cbe5bb6..8ab95ab3336 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -93,28 +93,28 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Parametrage du prefix $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')'; $texte.= ':'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte.= '  '; + $texte.= '  '; $texte.= ''; // Parametrage du prefix des avoirs $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte.= ''; if ($conf->global->MAIN_FEATURE_LEVEL >= 2) { // Parametrage du prefix des replacement $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte.= ''; // Parametrage du prefix des acomptes $texte.= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte.= ''; } diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 320c33dce7d..1d1bc920237 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -85,9 +85,9 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders // Parametrage du prefix $texte.= ''.$langs->trans("Mask").':'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte.= '  '; + $texte.= '  '; $texte.= ''; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index c1f6e003d6d..2b29a18e2f0 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -82,9 +82,9 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments // Parametrage du prefix $texte.= ''.$langs->trans("Mask").':'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte.= '  '; + $texte.= '  '; $texte.= ''; diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index f8cd365d5a7..d3a9de6c72b 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -85,9 +85,9 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal // Parametrage du prefix $texte.= ''.$langs->trans("Mask").':'; - $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte.= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte.= '  '; + $texte.= '  '; $texte.= ''; diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index f33042aca67..deb7c4481cc 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -81,9 +81,9 @@ class mod_ticket_universal extends ModeleNumRefTicket // Parametrage du prefix $texte .= '' . $langs->trans("Mask") . ':'; - $texte .= '' . $form->textwithpicto('', $tooltip, 1, 1) . ''; + $texte .= '' . $form->textwithpicto('', $tooltip, 1, 1) . ''; - $texte .= '  '; + $texte .= '  '; $texte .= ''; diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index d6b70d86a2d..fce35ff9202 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2019 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 @@ -55,7 +55,8 @@ foreach($object->fields as $key => $val) elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOSTISSET($key)?GETPOST($key, 'none'):$object->$key; else $value = GETPOSTISSET($key)?GETPOST($key, 'alpha'):$object->$key; //var_dump($val.' '.$key.' '.$value); - print $object->showInputField($val, $key, $value, '', '', '', 0); + if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0); + else print $object->showInputField($val, $key, $value, '', '', '', 0); print ''; print ''; } diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index e7f36bd358f..782385106db 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -52,7 +52,7 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket if ($action == 'delete') { $langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles -print $form->formconfirm( + print $form->formconfirm( $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6eaba659de0..388a9228024 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -278,6 +278,21 @@ else { } $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'maxwidth300'); + ?> + + '; echo ''; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index c223f3c76ff..dafe772a0eb 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -67,7 +67,13 @@ class Cronjob extends CommonObject public $md5params; public $module_name; public $priority; + /** + * @var string|int Date for last job execution + */ public $datelastrun=''; + /** + * @var string|int Date for next job execution + */ public $datenextrun=''; public $dateend=''; public $datestart=''; @@ -1220,7 +1226,7 @@ class Cronjob extends CommonObject $result=$user->fetch('', $userlogin); if ($result<0) { - $this->error="User Error:".$user->error; + $this->error="User Error : ".$user->error; dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 11d2b3acd35..ab905f745de 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -394,7 +394,7 @@ print ' '; print ' '; print ''; print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $search_status, 1); -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -505,11 +505,11 @@ if ($num > 0) if(!empty($obj->dateend)) {print dol_print_date($db->jdate($obj->dateend), 'dayhour');} print ''; - print ''; + print ''; if (!empty($obj->maxrun)) {print $obj->maxrun;} print ''; - print ''; + print ''; if (!empty($obj->nbrun)) {print $obj->nbrun;} else {print '0';} print ''; @@ -554,11 +554,11 @@ if ($num > 0) print ''; // Status - print ''; + print ''; print $object->getLibStatut(3); print ''; - print ''; + print ''; $backtourl = urlencode($_SERVER["PHP_SELF"].'?'.$param.($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'')); if ($user->rights->cron->create) diff --git a/htdocs/debugbar/class/DataCollector/DolConfigCollector.php b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php new file mode 100644 index 00000000000..a3fa8b84a92 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolConfigCollector.php @@ -0,0 +1,88 @@ +transnoentities('Config') => array( + "icon" => "gear", + "widget" => "PhpDebugBar.Widgets.VariableListWidget", + "map" => $this->getName(), + "default" => "{}" + ) + ); + } + + /** + * Return collected data + * + * @return array Array + */ + public function collect() + { + $this->data = $this->getConfig(); + + return parent::collect(); + } + + /** + * Returns an array with config data + * + * @return array Array of config + */ + protected function getConfig() + { + global $conf, $user; + + // Get constants + $const = get_defined_constants(true); + + $config = array( + 'Dolibarr' => array( + 'const' => $const['user'], + '$conf' => $this->objectToArray($conf), + '$user' => $this->objectToArray($user) + ), + 'PHP' => array( + 'version' => PHP_VERSION, + 'interface' => PHP_SAPI, + 'os' => PHP_OS + ) + ); + + return $config; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Convert an object to array + * + * @param mixed $obj Object + * @return array Array + */ + protected function objectToArray($obj) + { + // phpcs:enable + $_arr = is_object($obj) ? get_object_vars($obj) : $obj; + foreach ($_arr as $key => $val) { + $val = (is_array($val) || is_object($val)) ? $this->objectToArray($val) : $val; + $arr[$key] = $val; + } + + return $arr; + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php new file mode 100644 index 00000000000..15d433fd050 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolExceptionsCollector.php @@ -0,0 +1,35 @@ +transnoentities('Exceptions'); + + return array( + "$title" => array( + 'icon' => 'bug', + 'widget' => 'PhpDebugBar.Widgets.ExceptionsWidget', + 'map' => 'exceptions.exceptions', + 'default' => '[]' + ), + "$title:badge" => array( + 'map' => 'exceptions.count', + 'default' => 'null' + ) + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php new file mode 100644 index 00000000000..8c03bdc2830 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -0,0 +1,184 @@ +path = $path ?: $this->getLogsFile(); + $this->lines = empty($conf->global->DEBUGBAR_LOGS_LINES_NUMBER) ? 250 : $conf->global->DEBUGBAR_LOGS_LINES_NUMBER; // This slow seriously output + } + + /** + * Return widget settings + * + * @return array Array + */ + public function getWidgets() + { + global $langs; + + $title = $langs->transnoentities('Logs'); + $name = $this->getName(); + + return array( + "$title" => array( + "icon" => "list-alt", + "widget" => "PhpDebugBar.Widgets.MessagesWidget", + "map" => "$name.messages", + "default" => "[]" + ), + "$title:badge" => array( + "map" => "$name.count", + "default" => "null" + ) + ); + } + + /** + * Return collected data + * + * @return array Array + */ + public function collect() + { + $this->getStorageLogs($this->path); + + return parent::collect(); + } + + /** + * Get the path to the logs file + * + * @return string Path of log file + */ + public function getLogsFile() + { + // default dolibarr log file + $path = DOL_DATA_ROOT . '/dolibarr.log'; + + return $path; + } + + /** + * Get logs + * + * @param string $path Path + * @return array + */ + public function getStorageLogs($path) + { + if (! file_exists($path)) { + return; + } + + // Load the latest lines + $file = implode("", $this->tailFile($path, $this->lines)); + + foreach ($this->getLogs($file) as $log) { + $this->addMessage($log['line'], $log['level'], false); + } + } + + /** + * Get latest file lines + * + * @param string $file File + * @param int $lines Lines + * @return array Array + */ + protected function tailFile($file, $lines) + { + $handle = fopen($file, "r"); + $linecounter = $lines; + $pos = -2; + $beginning = false; + $text = []; + while ($linecounter > 0) { + $t = " "; + while ($t != "\n") { + if (fseek($handle, $pos, SEEK_END) == -1) { + $beginning = true; + break; + } + $t = fgetc($handle); + $pos--; + } + $linecounter--; + if ($beginning) { + rewind($handle); + } + $text[$lines - $linecounter - 1] = fgets($handle); + if ($beginning) { + break; + } + } + fclose($handle); + return array_reverse($text); + } + + /** + * Search a string for log entries + * + * @param string $file File + * @return array Lines of logs + */ + public function getLogs($file) + { + $pattern = "/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*/"; + $log_levels = $this->getLevels(); + preg_match_all($pattern, $file, $matches); + $log = []; + foreach ($matches as $lines) { + foreach ($lines as $line) { + foreach ($log_levels as $level_key => $level) { + if (strpos(strtolower($line), strtolower($level_key)) == 20) { + $log[] = ['level' => $level, 'line' => $line]; + } + } + } + } + $log = array_reverse($log); + return $log; + } + + /** + * Get the log levels from psr/log. + * + * @return array Array of log level + */ + public function getLevels() + { + $class = new ReflectionClass(new LogLevel()); + $levels = $class->getConstants(); + $levels['ERR'] = 'error'; + + return $levels; + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php new file mode 100644 index 00000000000..b6525633481 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolMemoryCollector.php @@ -0,0 +1,48 @@ +updatePeakUsage(); + return array( + 'peak_usage' => $this->peakUsage, + //'peak_usage_str' => $this->getDataFormatter()->formatBytes($this->peakUsage, 2) + 'peak_usage_str' => $this->peakUsage.' '.$langs->trans("bytes") + ); + } + + /** + * Return widget settings + * + * @return void + */ + public function getWidgets() + { + global $langs; + + $langs->load("other"); + + return array( + "memory" => array( + "icon" => "cogs", + "tooltip" => $langs->transnoentities('MemoryUsage'), + "map" => "memory.peak_usage_str", + "default" => "'0B'" + ) + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php b/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php new file mode 100644 index 00000000000..1fcf60c8ba6 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolMessagesCollector.php @@ -0,0 +1,36 @@ +transnoentities('Messages'); + $name = $this->getName(); + + return array( + "$title" => array( + "icon" => "list-alt", + "widget" => "PhpDebugBar.Widgets.MessagesWidget", + "map" => "$name.messages", + "default" => "[]" + ), + "$title:badge" => array( + "map" => "$name.count", + "default" => "null" + ) + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolQueryCollector.php b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php new file mode 100644 index 00000000000..694112bf2f1 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolQueryCollector.php @@ -0,0 +1,119 @@ +db = $db; + } + + /** + * Return collected data + * + * @return array Array + */ + public function collect() + { + $queries = array(); + $totalExecTime = 0; + $totalMemoryUsage = 0; + $totalFailed = 0; + foreach ($this->db->queries as $query) { + $queries[] = array( + 'sql' => $query['sql'], + 'duration' => $query['duration'], + 'duration_str' => $this->formatDuration($query['duration']), + 'memory' => $query['memory_usage'], + 'memory_str' => $this->formatBytes($query['memory_usage']), + 'is_success' => $query['is_success'], + 'error_code' => $query['error_code'], + 'error_message' => $query['error_message'] + ); + $totalExecTime += $query['duration']; + $totalMemoryUsage += $query['memory_usage']; + if (! $query['is_success']) { + $totalFailed += 1; + } + } + + return array( + 'nb_statements' => count($queries), + 'nb_failed_statements' => $totalFailed, + 'accumulated_duration' => $totalExecTime, + 'accumulated_duration_str' => $this->formatDuration($totalExecTime), + 'memory_usage' => $totalMemoryUsage, + 'memory_usage_str' => $this->formatBytes($totalMemoryUsage), + 'statements' => $queries + ); + } + + /** + * Return collector name + * + * @return string Name + */ + public function getName() + { + return 'query'; + } + + /** + * Return widget settings + * + * @return array Array + */ + public function getWidgets() + { + global $langs; + + $title = $langs->transnoentities('Database'); + + return array( + "$title" => array( + "icon" => "arrow-right", + "widget" => "PhpDebugBar.Widgets.SQLQueriesWidget", + "map" => "query", + "default" => "[]" + ), + "$title:badge" => array( + "map" => "query.nb_statements", + "default" => 0 + ) + ); + } + + /** + * Return assets + * + * @return array Array + */ + public function getAssets() + { + return array( + 'css' => 'widgets/sqlqueries/widget.css', + 'js' => 'widgets/sqlqueries/widget.js' + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php new file mode 100644 index 00000000000..e4d8e89159a --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolRequestDataCollector.php @@ -0,0 +1,31 @@ +load("other"); + + return array( + $langs->transnoentities('Request') => array( + "icon" => "tags", + "widget" => "PhpDebugBar.Widgets.VariableListWidget", + "map" => "request", + "default" => "{}" + ) + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php new file mode 100644 index 00000000000..ae69b16eba7 --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolTimeDataCollector.php @@ -0,0 +1,35 @@ + array( + "icon" => "clock-o", + "tooltip" => $langs->transnoentities('RequestDuration'), + "map" => "time.duration_str", + "default" => "'0ms'" + ), + $langs->transnoentities('Timeline') => array( + "icon" => "tasks", + "widget" => "PhpDebugBar.Widgets.TimelineWidget", + "map" => "time", + "default" => "{}" + ) + ); + } +} diff --git a/htdocs/debugbar/class/DataCollector/DolibarrCollector.php b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php new file mode 100644 index 00000000000..8bcd639ec7f --- /dev/null +++ b/htdocs/debugbar/class/DataCollector/DolibarrCollector.php @@ -0,0 +1,147 @@ +trans('Host') . ': ' . $conf->db->host . '
'; + $info .= $langs->trans('Port') . ': ' . $conf->db->port . '
'; + $info .= $langs->trans('Name') . ': ' . $conf->db->name . '
'; + $info .= $langs->trans('User') . ': ' . $conf->db->user . '
'; + $info .= $langs->trans('Type') . ': ' . $conf->db->type . '
'; + $info .= $langs->trans('Prefix') . ': ' . $conf->db->prefix . '
'; + $info .= $langs->trans('Charset') . ': ' . $conf->db->character_set . ''; + + return $info; + } + + /** + * Return dolibarr info as an HTML string + * + * @return string HTML string + */ + protected function getDolibarrInfo() + { + global $conf, $langs; + + $info = $langs->trans('Version') . ': ' . DOL_VERSION . '
'; + $info .= $langs->trans('Theme') . ': ' . $conf->theme . '
'; + $info .= $langs->trans('Locale') . ': ' . $conf->global->MAIN_LANG_DEFAULT . '
'; + $info .= $langs->trans('Currency') . ': ' . $conf->currency . '
'; + $info .= $langs->trans('DolEntity') . ': ' . $conf->entity . '
'; + $info .= $langs->trans('ListLimit') . ': ' . ($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT) . '
'; + $info .= $langs->trans('UploadSize') . ': ' . $conf->global->MAIN_UPLOAD_DOC . ''; + + return $info; + } + + /** + * Return mail info as an HTML string + * + * @return string HTML string + */ + protected function getMailInfo() + { + global $conf, $langs; + + $info = $langs->trans('Method') . ': ' . $conf->global->MAIN_MAIL_SENDMODE . '
'; + $info .= $langs->trans('Server') . ': ' . $conf->global->MAIN_MAIL_SMTP_SERVER . '
'; + $info .= $langs->trans('Port') . ': ' . $conf->global->MAIN_MAIL_SMTP_PORT . '
'; + $info .= $langs->trans('ID') . ': ' . $conf->global->MAIN_MAIL_SMTPS_ID . '
'; + $info .= $langs->trans('Pwd') . ': ' . $conf->global->MAIN_MAIL_SMTPS_PW . '
'; + $info .= $langs->trans('TLS/STARTTLS') . ': ' . $conf->global->MAIN_MAIL_EMAIL_TLS . ' / ' . $conf->global->MAIN_MAIL_EMAIL_STARTTLS . '
'; + $info .= $langs->trans('Status') . ': ' . ($conf->global->MAIN_DISABLE_ALL_MAILS ? $langs->trans('StatusDisabled') : $langs->trans('StatusEnabled')) . ''; + + return $info; + } + + /** + * Return widget settings + * + * @return array Array + */ + public function getWidgets() + { + return array( + "database_info" => array( + "icon" => "database", + "indicator" => "PhpDebugBar.DebugBar.TooltipIndicator", + "tooltip" => array( + "html" => $this->getDatabaseInfo(), + "class" => "tooltip-wide" + ), + "map" => "", + "default" => "" + ), + "dolibarr_info" => array( + "icon" => "desktop", + "indicator" => "PhpDebugBar.DebugBar.TooltipIndicator", + "tooltip" => array( + "html" => $this->getDolibarrInfo(), + "class" => "tooltip-wide" + ), + "map" => "", + "default" => "" + ), + "mail_info" => array( + "icon" => "envelope", + "indicator" => "PhpDebugBar.DebugBar.TooltipIndicator", + "tooltip" => array( + "html" => $this->getMailInfo(), + "class" => "tooltip-extra-wide" + ), + "map" => "", + "default" => "" + ) + ); + } + + /** + * Return collector assests + * + * @return array Array + */ + public function getAssets() + { + return array( + 'base_url' => dol_buildpath('/debugbar', 1), + 'js' => 'js/widgets.js' + ); + } +} diff --git a/htdocs/debugbar/class/DebugBar.php b/htdocs/debugbar/class/DebugBar.php new file mode 100644 index 00000000000..d3cc545e1b3 --- /dev/null +++ b/htdocs/debugbar/class/DebugBar.php @@ -0,0 +1,56 @@ +addCollector(new PhpInfoCollector()); + $this->addCollector(new DolMessagesCollector()); + $this->addCollector(new DolRequestDataCollector()); + $this->addCollector(new DolConfigCollector()); + $this->addCollector(new DolTimeDataCollector()); + $this->addCollector(new DolMemoryCollector()); + $this->addCollector(new DolExceptionsCollector()); + $this->addCollector(new DolQueryCollector()); + $this->addCollector(new DolibarrCollector()); + if ($conf->syslog->enabled) { + $this->addCollector(new DolLogsCollector()); + } + } + + /** + * Returns a JavascriptRenderer for this instance + * + * @return string String content + */ + public function getRenderer() + { + return parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/DebugBar/Resources'); + } +} diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php new file mode 100644 index 00000000000..0caf6c2489f --- /dev/null +++ b/htdocs/debugbar/class/TraceableDB.php @@ -0,0 +1,698 @@ +db::LABEL (but this is a constant? o_O) + /** + * @const Version min database + */ + const VERSIONMIN = ''; // TODO: the same thing here, $this->db::VERSIONMIN is the right value + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + $this->type = $db->type; + $this->queries = array(); + } + + /** + * Format a SQL IF + * + * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string + */ + public function ifsql($test, $resok, $resko) + { + return $this->db->ifsql($test, $resok, $resko); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return datas as an array + * + * @param resource $resultset Resultset of request + * @return array Array + */ + public function fetch_row($resultset) + { + // phpcs:enable + return $this->db->fetch_row($resultset); + } + + /** + * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. + * Function to use to build INSERT, UPDATE or WHERE predica + * + * @param int $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS + */ + public function idate($param) + { + return $this->db->idate($param); + } + + /** + * Return last error code + * + * @return string lasterrno + */ + public function lasterrno() + { + return $this->db->lasterrno(); + } + + /** + * Start transaction + * + * @return int 1 if transaction successfuly opened or already opened, 0 if error + */ + public function begin() + { + return $this->db->begin(); + } + + /** + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO + */ + public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') + { + return $this->db->DDLCreateDb($database, $charset, $collation, $owner); + } + + /** + * Return version of database server into an array + * + * @return array Version array + */ + public function getVersionArray() + { + return $this->db->getVersionArray(); + } + + /** + * Convert a SQL request in Mysql syntax to native syntax + * + * @param string $line SQL request line to convert + * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) + * @return string SQL request line converted + */ + public static function convertSQLFromMysql($line, $type = 'ddl') + { + return $this->db->convertSQLFromMysql($line); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * + * @param resource $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows() + */ + public function affected_rows($resultset) + { + // phpcs:enable + return $this->db->affected_rows($resultset); + } + + /** + * Return description of last error + * + * @return string Error text + */ + public function error() + { + return $this->db->error(); + } + + /** + * List tables into a database + * + * @param string $database Name of database + * @param string $table Nmae of table filter ('xxx%') + * @return array List of tables in an array + */ + public function DDLListTables($database, $table = '') + { + return $this->db->DDLListTables($database, $table); + } + + /** + * Return last request executed with query() + * + * @return string Last query + */ + public function lastquery() + { + return $this->db->lastquery(); + } + + /** + * Define sort criteria of request + * + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + */ + public function order($sortfield = null, $sortorder = null) + { + return $this->db->order($sortfield, $sortorder); + } + + /** + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used + */ + public function decrypt($value) + { + return $this->db->decrypt($value); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return datas as an array + * + * @param resource $resultset Resultset of request + * @return array Array + */ + public function fetch_array($resultset) + { + // phpcs:enable + return $this->db->fetch_array($resultset); + } + + /** + * Return last error label + * + * @return string lasterror + */ + public function lasterror() + { + return $this->db->lasterror(); + } + + /** + * Escape a string to insert data + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ + public function escape($stringtoencode) + { + return $this->db->escape($stringtoencode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Get last ID after an insert INSERT + * + * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql + * @param string $fieldid Field name + * @return int Id of row + */ + public function last_insert_id($tab, $fieldid = 'rowid') + { + // phpcs:enable + return $this->db->last_insert_id($tab, $fieldid); + } + + /** + * Return full path of restore program + * + * @return string Full path of restore program + */ + public function getPathOfRestore() + { + return $this->db->getPathOfRestore(); + } + + /** + * Annulation d'une transaction et retour aux anciennes valeurs + * + * @param string $log Add more log to default log line + * @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur + */ + public function rollback($log = '') + { + return $this->db->rollback($log); + } + + /** + * Execute a SQL request and return the resultset + * + * @param string $query SQL query string + * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). + * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. + * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) + * @return resource Resultset of answer + */ + public function query($query, $usesavepoint = 0, $type = 'auto') + { + $this->startTracing(); + + $resql = $this->db->query($query, $usesavepoint, $type); + + $this->endTracing($query, $resql); + + return $resql; + } + + /** + * Start query tracing + * + * @return void + */ + protected function startTracing() + { + $this->startTime = microtime(true); + $this->startMemory = memory_get_usage(true); + } + + /** + * End query tracing + * + * @param string $sql query string + * @param string $resql query result + * @return void + */ + protected function endTracing($sql, $resql) + { + $endTime = microtime(true); + $duration = $endTime - $this->startTime; + $endMemory = memory_get_usage(true); + $memoryDelta = $endMemory - $this->startMemory; + + $this->queries[] = array( + 'sql' => $sql, + 'duration' => $duration, + 'memory_usage' => $memoryDelta, + 'is_success' => $resql, + 'error_code' => ! $resql ? $this->db->lasterrno() : null, + 'error_message' => ! $resql ? $this->db->lasterror() : null + ); + } + + /** + * Connexion to server + * + * @param string $host database server host + * @param string $login login + * @param string $passwd password + * @param string $name name of database (not used for mysql, used for pgsql) + * @param int $port Port of database server + * @return resource Database access handler + * @see close() + */ + public function connect($host, $login, $passwd, $name, $port = 0) + { + return $this->db->connect($host, $login, $passwd, $name, $port); + } + + /** + * Define limits and offset of request + * + * @param int $limit Maximum number of lines returned (-1=conf->liste_limit, 0=no limit) + * @param int $offset Numero of line from where starting fetch + * @return string String with SQL syntax to add a limit and offset + */ + public function plimit($limit = 0, $offset = 0) + { + return $this->db->plimit($limit, $offset); + } + + /** + * Return value of server parameters + * + * @param string $filter Filter list on a particular value + * @return array Array of key-values (key=>value) + */ + public function getServerParametersValues($filter = '') + { + return $this->db->getServerParametersValues($filter); + } + + /** + * Return value of server status + * + * @param string $filter Filter list on a particular value + * @return array Array of key-values (key=>value) + */ + public function getServerStatusValues($filter = '') + { + return $this->db->getServerStatusValues($filter); + } + + /** + * Return collation used in database + * + * @return string Collation value + */ + public function getDefaultCollationDatabase() + { + return $this->db->getDefaultCollationDatabase(); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return number of lines for result of a SELECT + * + * @param resource $resultset Resulset of requests + * @return int Nb of lines + * @see affected_rows() + */ + public function num_rows($resultset) + { + // phpcs:enable + return $this->db->num_rows($resultset); + } + + /** + * Return full path of dump program + * + * @return string Full path of dump program + */ + public function getPathOfDump() + { + return $this->db->getPathOfDump(); + } + + /** + * Return version of database client driver + * + * @return string Version string + */ + public function getDriverInfo() + { + return $this->db->getDriverInfo(); + } + + /** + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + */ + public function errno() + { + return $this->db->errno(); + } + + /** + * Create a table into database + * + * @param string $table Name of table + * @param array $fields Tableau associatif [nom champ][tableau des descriptions] + * @param string $primary_key Nom du champ qui sera la clef primaire + * @param string $type Type de la table + * @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur + * @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext + * @param array $keys Tableau des champs cles noms => valeur + * @return int <0 if KO, >=0 if OK + */ + public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) + { + return $this->db->DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys, $fulltext_keys, $keys); + } + + /** + * Drop a table into database + * + * @param string $table Name of table + * @return int <0 if KO, >=0 if OK + */ + public function DDLDropTable($table) + { + return $this->db->DDLDropTable($table); + } + + /** + * Return list of available charset that can be used to store data in database + * + * @return array List of Charset + */ + public function getListOfCharacterSet() + { + return $this->db->getListOfCharacterSet(); + } + + /** + * Create a new field into table + * + * @param string $table Name of table + * @param string $field_name Name of field to add + * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] + * @param string $field_position Optionnel ex.: "after champtruc" + * @return int <0 if KO, >0 if OK + */ + public function DDLAddField($table, $field_name, $field_desc, $field_position = "") + { + return $this->db->DDLAddField($table, $field_name, $field_desc, $field_position); + } + + /** + * Drop a field from table + * + * @param string $table Name of table + * @param string $field_name Name of field to drop + * @return int <0 if KO, >0 if OK + */ + public function DDLDropField($table, $field_name) + { + return $this->db->DDLDropField($table, $field_name); + } + + /** + * Update format of a field into a table + * + * @param string $table Name of table + * @param string $field_name Name of field to modify + * @param string $field_desc Array with description of field format + * @return int <0 if KO, >0 if OK + */ + public function DDLUpdateField($table, $field_name, $field_desc) + { + return $this->db->DDLUpdateField($table, $field_name, $field_desc); + } + + /** + * Return list of available collation that can be used for database + * + * @return array List of Collation + */ + public function getListOfCollation() + { + return $this->db->getListOfCollation(); + } + + /** + * Return a pointer of line with description of a table or field + * + * @param string $table Name of table + * @param string $field Optionnel : Name of field if we want description of field + * @return resource Resource + */ + public function DDLDescTable($table, $field = "") + { + return $this->db->DDLDescTable($table, $field); + } + + /** + * Return version of database server + * + * @return string Version string + */ + public function getVersion() + { + return $this->db->getVersion(); + } + + /** + * Return charset used to store data in database + * + * @return string Charset + */ + public function getDefaultCharacterSetDatabase() + { + return $this->db->getDefaultCharacterSetDatabase(); + } + + /** + * Create a user and privileges to connect to database (even if database does not exists yet) + * + * @param string $dolibarr_main_db_host Ip serveur + * @param string $dolibarr_main_db_user Nom user a creer + * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_name Database name where user must be granted + * @return int <0 if KO, >=0 if OK + */ + public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) + { + return $this->db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) + * 19700101020000 -> 3600 with TZ+1 and gmt=0 + * 19700101020000 -> 7200 whaterver is TZ if gmt=1 + * + * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) + * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ + * @return int|string Date TMS or '' + */ + public function jdate($string, $gm = false) + { + // phpcs:enable + return $this->db->jdate($string, $gm); + } + + /** + * Encrypt sensitive data in database + * Warning: This function includes the escape, so it must use direct value + * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return string XXX(field) or XXX('value') or field or 'value' + */ + public function encrypt($fieldorvalue, $withQuotes = 0) + { + return $this->db->encrypt($fieldorvalue, $withQuotes); + } + + /** + * Validate a database transaction + * + * @param string $log Add more log to default log line + * @return int 1 if validation is OK or transaction level no started, 0 if ERROR + */ + public function commit($log = '') + { + return $this->db->commit($log); + } + + /** + * List information of columns into a table. + * + * @param string $table Name of table + * @return array Array with inforation on table + */ + public function DDLInfoTable($table) + { + return $this->db->DDLInfoTable($table); + } + + /** + * Free last resultset used. + * + * @param resource $resultset Fre cursor + * @return void + */ + public function free($resultset = null) + { + return $this->db->free($resultset); + } + + /** + * Close database connexion + * + * @return boolean True if disconnect successfull, false otherwise + * @see connect() + */ + public function close() + { + return $this->db->close(); + } + + /** + * Return last query in error + * + * @return string lastqueryerror + */ + public function lastqueryerror() + { + return $this->db->lastqueryerror(); + } + + /** + * Return connexion ID + * + * @return string Id connexion + */ + public function DDLGetConnectId() + { + return $this->db->DDLGetConnectId(); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoie la ligne courante (comme un objet) pour le curseur resultset + * + * @param resource $resultset Curseur de la requete voulue + * @return Object Object result line or false if KO or end of cursor + */ + public function fetch_object($resultset) + { + // phpcs:enable + return $this->db->fetch_object($resultset); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Select a database + * + * @param string $database Name of database + * @return boolean true if OK, false if KO + */ + public function select_db($database) + { + // phpcs:enable + return $this->db->select_db($database); + } +} diff --git a/htdocs/debugbar/class/actions_debugbar.class.php b/htdocs/debugbar/class/actions_debugbar.class.php new file mode 100644 index 00000000000..08790ca1cd3 --- /dev/null +++ b/htdocs/debugbar/class/actions_debugbar.class.php @@ -0,0 +1,113 @@ +getRenderer(); + $conf->global->MAIN_HTML_HEADER .= $renderer->renderHead(); + } + + /** + * Overloading the afterLogin function + * + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null + * @param HookManager $hookmanager Hook manager propagated to allow calling another hook + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function afterLogin($parameters, &$object, &$action, $hookmanager) + { + $error = 0; // Error counter + + if (in_array('login', explode(':', $parameters['context']))) + { + $this->loadDebugBar(); + } + + if (! $error) + { + return 0; // or return 1 to replace standard code + } + else + { + return -1; + } + } + + /** + * Overloading the updateSession function + * + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null + * @param HookManager $hookmanager Hook manager propagated to allow calling another hook + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function updateSession($parameters, &$object, &$action, $hookmanager) + { + $error = 0; // Error counter + + if (in_array('main', explode(':', $parameters['context']))) + { + $this->loadDebugBar(); + } + + if (! $error) + { + return 0; // or return 1 to replace standard code + } + else + { + return -1; + } + } + + /** + * Overloading the printCommonFooter function + * + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @param string $action Current action (if set). Generally create or edit or null + * @param HookManager $hookmanager Hook manager propagated to allow calling another hook + * @return int <0 on error, 0 on success, 1 to replace standard code + */ + public function printCommonFooter($parameters, &$object, &$action, $hookmanager) + { + global $user, $debugbar, $langs; + + $error = 0; // Error counter + $context = explode(':', $parameters['context']); + + if (in_array('main', $context) || in_array('login', $context)) + { + if ($user->rights->debugbar->read && is_object($debugbar)) { + $renderer = $debugbar->getRenderer(); + echo $renderer->render(); + } + } + + if (! $error) + { + return 0; // or return 1 to replace standard code + } + else + { + return -1; + } + } +} diff --git a/htdocs/debugbar/class/autoloader.php b/htdocs/debugbar/class/autoloader.php new file mode 100644 index 00000000000..1d5c85c975d --- /dev/null +++ b/htdocs/debugbar/class/autoloader.php @@ -0,0 +1,18 @@ + '', 'class' => '') + * - data: alias of title + */ + var TooltipIndicator = PhpDebugBar.DebugBar.TooltipIndicator = PhpDebugBar.DebugBar.Indicator.extend({ + + render: function() { + this.$icon = $('').appendTo(this.$el); + this.bindAttr('icon', function(icon) { + if (icon) { + this.$icon.attr('class', 'fa fa-' + icon); + } else { + this.$icon.attr('class', ''); + } + }); + + this.bindAttr(['title', 'data'], $('').addClass(csscls('text')).appendTo(this.$el)); + + this.$tooltip = $('').addClass(csscls('tooltip disabled')).appendTo(this.$el); + this.bindAttr('tooltip', function(tooltip) { + if (tooltip['html']) { + tooltipHTML = $('').html(tooltip['html']).addClass(csscls('tooltip-html')); + this.$tooltip.html(tooltipHTML).removeClass(csscls('disabled')); + if (tooltip['class']) { + this.$tooltip.addClass(csscls(tooltip['class'])); + } + } else { + this.$tooltip.addClass(csscls('disabled')); + } + }); + } + + }); + + /** + * LinkIndicator + * + * A customised indicator class that will allow "click" behaviour. + * + * Options: + * - icon + * - title + * - tooltip + * - data: alias of title + * - href + * - target + */ + var LinkIndicator = PhpDebugBar.DebugBar.LinkIndicator = PhpDebugBar.DebugBar.Indicator.extend({ + + tagName: 'a', + + render: function() { + LinkIndicator.__super__.render.apply(this); + this.bindAttr('href', function(href) { + this.$el.attr('href', href); + }); + this.bindAttr('target', function(target) { + this.$el.attr('target', target); + }); + } + + }); + +})(PhpDebugBar.$); \ No newline at end of file diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d88017e52ea..08eb9efb094 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -397,7 +397,7 @@ if ($action == 'create') print "".''.$langs->trans("Lastname").''; print "".''.$langs->trans("Firstname").''; print "".''.$langs->trans("Address").''; - print ''; + print ''; // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; @@ -544,7 +544,7 @@ if ( $object->socid && ! empty($conf->societe->enabled) && ! empty($conf->global print ''.$langs->trans("Lastname").''; print ''.$langs->trans("Firstname").''; print ''.$langs->trans("Address").''; - print ''; + print ''; // Zip / Town print ''.$langs->trans("Zip").' / '.$langs->trans("Town").''; diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 951c2586346..a5e296ae1e6 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -137,10 +137,10 @@ print ''; print ''; print ""; print ''; -print "'; -print "'; -print "'; -print "'; +print "'; +print "'; +print "'; +print "'; print "
'.$langs->trans("ECMSearchByKeywords").'
".$langs->trans("Ref").':
".$langs->trans("Title").':
".$langs->trans("Keyword").':
".$langs->trans("Ref").':
".$langs->trans("Title").':
".$langs->trans("Keyword").':
"; //print $langs->trans("ECMSectionManualDesc"); @@ -162,7 +162,7 @@ foreach($sectionauto as $sectioncur) print "".$sectioncur['label'].':'; print ''; print ''; print ''; @@ -173,7 +173,7 @@ foreach($sectionauto as $sectioncur) //if ($butshown % 2 == 1) // print '  '; -print ''; +print ''; print ""; //print $langs->trans("ECMSectionAutoDesc"); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 5a063fcbf4a..181e8b89a59 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -54,7 +54,7 @@ if (! empty($conf->projet->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array("sendings","companies","bills",'deliveries','orders','stocks','other','propal')); +$langs->loadLangs(array("sendings", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); @@ -101,7 +101,7 @@ $extralabelslines=$extrafieldsline->fetch_name_optionals_label($object->table_el include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('expeditioncard','globalcard')); +$hookmanager->initHooks(array('expeditioncard', 'globalcard')); $permissiondellink=$user->rights->expedition->livraison->creer; // Used by the include of actions_dellink.inc.php //var_dump($object->lines[0]->detail_batch); @@ -479,7 +479,7 @@ if (empty($reshook)) } } // TODO add alternative status - /*else if ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate))) + /*elseif ($action == 'reopen' && (! empty($user->rights->expedition->creer) || ! empty($user->rights->expedition->shipping_advance->validate))) { $result = $object->setStatut(0); if ($result < 0) @@ -784,7 +784,8 @@ if (empty($reshook)) $stockLocation="entl".$detail_entrepot->line_id; $qty = "qtyl".$detail_entrepot->line_id; $warehouse = GETPOST($stockLocation, 'int'); - if (!empty($warehouse)) { + if (!empty($warehouse)) + { $line->id = $detail_entrepot->line_id; $line->entrepot_id = $warehouse; $line->qty = GETPOST($qty, 'int'); @@ -968,7 +969,7 @@ if ($action == 'create') // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - //print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. + //print dol_print_date($object->date_livraison, "day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery?$date_delivery:$object->date_livraison); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery?$date_delivery:-1, 'date_delivery', 1, 1, 1); print "\n"; @@ -1136,449 +1137,455 @@ if ($action == 'create') $line = $object->lines[$indiceAsked]; + $parameters = array('i' => $indiceAsked, 'line' => $line, 'num' => $numAsked); + $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - // Show product and description - $type=$line->product_type?$line->product_type:$line->fk_product_type; - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($line->date_start)) $type=1; - if (! empty($line->date_end)) $type=1; - - print ''."\n"; - print ''."\n"; - - // Product label - if ($line->fk_product > 0) // If predefined product + if (empty($reshook)) { - $product->fetch($line->fk_product); - $product->load_stock('warehouseopen'); // Load all $product->stock_warehouse[idwarehouse]->detail_batch - //var_dump($product->stock_warehouse[1]); + // Show product and description + $type=$line->product_type?$line->product_type:$line->fk_product_type; + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (! empty($line->date_start)) $type=1; + if (! empty($line->date_end)) $type=1; - print ''; - print ''; // ancre pour retourner sur la ligne + print ''."\n"; + print ''."\n"; - // Show product and description - $product_static->type=$line->fk_product_type; - $product_static->id=$line->fk_product; - $product_static->ref=$line->ref; - $product_static->status_batch=$line->product_tobatch; - $text=$product_static->getNomUrl(1); - $text.= ' - '.(! empty($line->label)?$line->label:$line->product_label); - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->desc)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); + // Product label + if ($line->fk_product > 0) // If predefined product + { + $product->fetch($line->fk_product); + $product->load_stock('warehouseopen'); // Load all $product->stock_warehouse[idwarehouse]->detail_batch + //var_dump($product->stock_warehouse[1]); - // Show range - print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); + print ''; + print ''; // ancre pour retourner sur la ligne - // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) - { - print ($line->desc && $line->desc!=$line->product_label)?'
'.dol_htmlentitiesbr($line->desc):''; - } + // Show product and description + $product_static->type=$line->fk_product_type; + $product_static->id=$line->fk_product; + $product_static->ref=$line->ref; + $product_static->status_batch=$line->product_tobatch; + $text=$product_static->getNomUrl(1); + $text.= ' - '.(! empty($line->label)?$line->label:$line->product_label); + $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->desc)); + print $form->textwithtooltip($text, $description, 3, '', '', $i); - print ''; - } - else - { - print ""; - if ($type==1) $text = img_object($langs->trans('Service'), 'service'); - else $text = img_object($langs->trans('Product'), 'product'); + // Show range + print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); - if (! empty($line->label)) { - $text.= ' '.$line->label.''; - print $form->textwithtooltip($text, $line->desc, 3, '', '', $i); - } else { - print $text.' '.nl2br($line->desc); - } + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print ($line->desc && $line->desc!=$line->product_label)?'
'.dol_htmlentitiesbr($line->desc):''; + } - // Show range - print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); - print "\n"; - } - - // Qty - print ''.$line->qty; - print ''; - print ''; - $qtyProdCom=$line->qty; - - // Qty already shipped - print ''; - $quantityDelivered = $object->expeditions[$line->id]; - print $quantityDelivered; - print ''; - print ''; - - // Qty to ship - $quantityAsked = $line->qty; - if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $quantityToBeDelivered = 0; - } - else - { - $quantityToBeDelivered = $quantityAsked - $quantityDelivered; - } - $warehouse_id = GETPOST('entrepot_id', 'int'); - - $warehouseObject = null; - if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection - { - print ''; - //ship from preselected location - $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number - $deliverableQty=min($quantityToBeDelivered, $stock); - if ($deliverableQty < 0) $deliverableQty = 0; - if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) + print ''; + } + else { - // Quantity to send - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - if (GETPOST('qtyl'.$indiceAsked, 'int')) $deliverableQty=GETPOST('qtyl'.$indiceAsked, 'int'); - print ''; - print ''; - } - else print $langs->trans("NA"); - print ''; + print ""; + if ($type==1) $text = img_object($langs->trans('Service'), 'service'); + else $text = img_object($langs->trans('Product'), 'product'); - // Stock - if (! empty($conf->stock->enabled)) - { - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Type of product need stock change ? - { - // Show warehouse combo list - $ent = "entl".$indiceAsked; - $idl = "idl".$indiceAsked; - $tmpentrepot_id = is_numeric(GETPOST($ent, 'int'))?GETPOST($ent, 'int'):$warehouse_id; - if ($line->fk_product > 0) - { - print ''; - print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1); - if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) - { - //print $stock.' '.$quantityToBeDelivered; - if ($stock < $quantityToBeDelivered) - { - print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse - } - } - } - } - else - { - print $langs->trans("Service"); - } - print ''; - } + if (! empty($line->label)) { + $text.= ' '.$line->label.''; + print $form->textwithtooltip($text, $line->desc, 3, '', '', $i); + } else { + print $text.' '.nl2br($line->desc); + } - print "\n"; + // Show range + print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); + print "\n"; + } - // Show subproducts of product - if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) - { - $product->get_sousproduits_arbo(); - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - if(count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - //print $value[0]; - $img=''; - if ($value['stock'] < $value['stock_alert']) - { - $img=img_warning($langs->trans("StockTooLow")); - } - print "      -> - ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   - ".$value['stock']." ".$img.""; - } - } - } + // Qty + print ''.$line->qty; + print ''; + print ''; + $qtyProdCom=$line->qty; + + // Qty already shipped + print ''; + $quantityDelivered = $object->expeditions[$line->id]; + print $quantityDelivered; + print ''; + print ''; + + // Qty to ship + $quantityAsked = $line->qty; + if ($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $quantityToBeDelivered = 0; } else { - // Product need lot - print ''; // end line and start a new one for lot/serial - print ''; + $quantityToBeDelivered = $quantityAsked - $quantityDelivered; + } + $warehouse_id = GETPOST('entrepot_id', 'int'); - $staticwarehouse=new Entrepot($db); - if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id); - - $subj=0; - // Define nb of lines suggested for this order line - $nbofsuggested=0; - if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) + $warehouseObject = null; + if ($warehouse_id > 0 || ! ($line->fk_product > 0) || empty($conf->stock->enabled)) // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + { + print ''; + //ship from preselected location + $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number + $deliverableQty=min($quantityToBeDelivered, $stock); + if ($deliverableQty < 0) $deliverableQty = 0; + if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) { - foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) - { - $nbofsuggested++; - } - } - print ''; - if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) - { - foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) // $dbatch is instance of Productbatch + // Quantity to send + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - //var_dump($dbatch); - $batchStock = + $dbatch->qty; // To get a numeric - $deliverableQty = min($quantityToBeDelivered, $batchStock); - print ''; - print ''; - print ''; - print ''; + if (GETPOST('qtyl'.$indiceAsked, 'int')) $deliverableQty=GETPOST('qtyl'.$indiceAsked, 'int'); + print ''; + print ''; + } + else print $langs->trans("NA"); + print ''; - print ''; + // Stock + if (! empty($conf->stock->enabled)) + { print ''; - - print $staticwarehouse->getNomUrl(0).' / '; - - print ''; - - $detail=''; - $detail.= $langs->trans("Batch").': '.$dbatch->batch; - $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); - $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; - $detail.= '
'; - print $detail; - - $quantityToBeDelivered -= $deliverableQty; - if ($quantityToBeDelivered < 0) + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) // Type of product need stock change ? { - $quantityToBeDelivered = 0; + // Show warehouse combo list + $ent = "entl".$indiceAsked; + $idl = "idl".$indiceAsked; + $tmpentrepot_id = is_numeric(GETPOST($ent, 'int'))?GETPOST($ent, 'int'):$warehouse_id; + if ($line->fk_product > 0) + { + print ''; + print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 1, 0, $line->fk_product, '', 1); + if ($tmpentrepot_id > 0 && $tmpentrepot_id == $warehouse_id) + { + //print $stock.' '.$quantityToBeDelivered; + if ($stock < $quantityToBeDelivered) + { + print ' '.img_warning($langs->trans("StockTooLow")); // Stock too low for this $warehouse_id but you can change warehouse + } + } + } + } + else + { + print $langs->trans("Service"); + } + print ''; + } + + print "\n"; + + // Show subproducts of product + if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) + { + $product->get_sousproduits_arbo(); + $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); + if(count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + //print $value[0]; + $img=''; + if ($value['stock'] < $value['stock_alert']) + { + $img=img_warning($langs->trans("StockTooLow")); + } + print "      -> + ".$value['fullpath']." + (".$value['nb'].") ".$value['nb_total']."   + ".$value['stock']." ".$img.""; + } } - $subj++; - print ''; } } else { - print ''; - print ''; - print ' '; - print ''; + // Product need lot + print ''; // end line and start a new one for lot/serial + print ''; - print ''; - print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle); - print ''; - } - } - } - else - { - // ship from multiple locations - if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) - { - print ''; - print ''."\n"; // end line and start a new one for each warehouse + $staticwarehouse=new Entrepot($db); + if ($warehouse_id > 0) $staticwarehouse->fetch($warehouse_id); - print ''; - $subj=0; - // Define nb of lines suggested for this order line - $nbofsuggested=0; - foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) - { - if ($stock_warehouse->real > 0) + $subj=0; + // Define nb of lines suggested for this order line + $nbofsuggested=0; + if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) { - $nbofsuggested++; + foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) + { + $nbofsuggested++; + } } - } - $tmpwarehouseObject=new Entrepot($db); - foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock - { - $tmpwarehouseObject->fetch($warehouse_id); - if ($stock_warehouse->real > 0) + print ''; + if (is_object($product->stock_warehouse[$warehouse_id]) && count($product->stock_warehouse[$warehouse_id]->detail_batch)) { - $stock = + $stock_warehouse->real; // Convert it to number - $deliverableQty = min($quantityToBeDelivered, $stock); - $deliverableQty = max(0, $deliverableQty); - // Quantity to send - print ''; - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - print ''; - print ''; - } - else print $langs->trans("NA"); - print ''; - - // Stock - if (! empty($conf->stock->enabled)) - { - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - print $tmpwarehouseObject->getNomUrl(0).' '; - - print ''; - print '('.$stock.')'; - } - else - { - print $langs->trans("Service"); - } - print ''; - } - $quantityToBeDelivered -= $deliverableQty; - if ($quantityToBeDelivered < 0) - { - $quantityToBeDelivered = 0; - } - $subj++; - print "\n"; - } - } - // Show subproducts of product (not recommanded) - if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) - { - $product->get_sousproduits_arbo(); - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - if (count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - //print $value[0]; - $img=''; - if ($value['stock'] < $value['stock_alert']) - { - $img=img_warning($langs->trans("StockTooLow")); - } - print ''; - print "      -> - ".$value['fullpath']." - (".$value['nb'].") ".$value['nb_total']."   - ".$value['stock']." ".$img.""; - print ""; - } - } - } - } - else - { - print ''; - print ''; // end line and start a new one for lot/serial - - $subj=0; - print ''; - - $tmpwarehouseObject=new Entrepot($db); - $productlotObject=new Productlot($db); - // Define nb of lines suggested for this order line - $nbofsuggested=0; - foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) - { - if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { - foreach ($stock_warehouse->detail_batch as $dbatch) - { - $nbofsuggested++; - } - } - } - foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) - { - $tmpwarehouseObject->fetch($warehouse_id); - if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { - foreach ($stock_warehouse->detail_batch as $dbatch) + foreach ($product->stock_warehouse[$warehouse_id]->detail_batch as $dbatch) // $dbatch is instance of Productbatch { //var_dump($dbatch); $batchStock = + $dbatch->qty; // To get a numeric $deliverableQty = min($quantityToBeDelivered, $batchStock); - if ($deliverableQty < 0) $deliverableQty = 0; - print ''; + print ''; + print ''; print ''; print ''; + print ''; print ''; - print $tmpwarehouseObject->getNomUrl(0).' / '; + print $staticwarehouse->getNomUrl(0).' / '; - print ''; print ''; - //print '|'.$line->fk_product.'|'.$dbatch->batch.'|
'; - print $langs->trans("Batch").': '; - $result = $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); - if ($result > 0) print $productlotObject->getNomUrl(1); - else print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed'; - print ' ('.$dbatch->qty.')'; + $detail=''; + $detail.= $langs->trans("Batch").': '.$dbatch->batch; + $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); + $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; + $detail.= '
'; + print $detail; + $quantityToBeDelivered -= $deliverableQty; if ($quantityToBeDelivered < 0) { $quantityToBeDelivered = 0; } - //dol_syslog('deliverableQty = '.$deliverableQty.' batchStock = '.$batchStock); $subj++; print ''; } } + else + { + print ''; + print ''; + print ' '; + print ''; + + print ''; + print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $staticwarehouse->libelle); + print ''; + } } } - if ($subj == 0) // Line not shown yet, we show it + else { - print ''; - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + // ship from multiple locations + if (empty($conf->productbatch->enabled) || ! $product->hasbatch()) { - $disabled=''; - if (! empty($conf->productbatch->enabled) && $product->hasbatch()) - { - $disabled='disabled="disabled"'; - } - print ' '; - } - else - { - print $langs->trans("NA"); - } - print ''; + print ''; + print ''."\n"; // end line and start a new one for each warehouse - print ''; - if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $warehouse_selected_id = GETPOST('entrepot_id', 'int'); - if ($warehouse_selected_id > 0) - { - $warehouseObject=new Entrepot($db); - $warehouseObject->fetch($warehouse_selected_id); - print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle); - } - else - { - if ($line->fk_product) print img_warning().' '.$langs->trans("StockTooLow"); - else print ''; - } + print ''; + $subj=0; + // Define nb of lines suggested for this order line + $nbofsuggested=0; + foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) + { + if ($stock_warehouse->real > 0) + { + $nbofsuggested++; + } + } + $tmpwarehouseObject=new Entrepot($db); + foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock + { + $tmpwarehouseObject->fetch($warehouse_id); + if ($stock_warehouse->real > 0) + { + $stock = + $stock_warehouse->real; // Convert it to number + $deliverableQty = min($quantityToBeDelivered, $stock); + $deliverableQty = max(0, $deliverableQty); + // Quantity to send + print ''; + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + print ''; + print ''; + } + else print $langs->trans("NA"); + print ''; + + // Stock + if (! empty($conf->stock->enabled)) + { + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + print $tmpwarehouseObject->getNomUrl(0).' '; + + print ''; + print '('.$stock.')'; + } + else + { + print $langs->trans("Service"); + } + print ''; + } + $quantityToBeDelivered -= $deliverableQty; + if ($quantityToBeDelivered < 0) + { + $quantityToBeDelivered = 0; + } + $subj++; + print "\n"; + } + } + // Show subproducts of product (not recommanded) + if (! empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) + { + $product->get_sousproduits_arbo(); + $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); + if (count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + //print $value[0]; + $img=''; + if ($value['stock'] < $value['stock_alert']) + { + $img=img_warning($langs->trans("StockTooLow")); + } + print ''; + print "      -> + ".$value['fullpath']." + (".$value['nb'].") ".$value['nb_total']."   + ".$value['stock']." ".$img.""; + print ""; + } + } + } } else { - print $langs->trans("Service"); + print ''; + print ''; // end line and start a new one for lot/serial + + $subj=0; + print ''; + + $tmpwarehouseObject=new Entrepot($db); + $productlotObject=new Productlot($db); + // Define nb of lines suggested for this order line + $nbofsuggested=0; + foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) + { + if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { + foreach ($stock_warehouse->detail_batch as $dbatch) + { + $nbofsuggested++; + } + } + } + foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) + { + $tmpwarehouseObject->fetch($warehouse_id); + if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { + foreach ($stock_warehouse->detail_batch as $dbatch) + { + //var_dump($dbatch); + $batchStock = + $dbatch->qty; // To get a numeric + $deliverableQty = min($quantityToBeDelivered, $batchStock); + if ($deliverableQty < 0) $deliverableQty = 0; + print ''; + print ''; + print ''; + + print ''; + + print $tmpwarehouseObject->getNomUrl(0).' / '; + + print ''; + print ''; + + //print '|'.$line->fk_product.'|'.$dbatch->batch.'|
'; + print $langs->trans("Batch").': '; + $result = $productlotObject->fetch(0, $line->fk_product, $dbatch->batch); + if ($result > 0) print $productlotObject->getNomUrl(1); + else print 'TableLotIncompleteRunRepairWithParamStandardEqualConfirmed'; + print ' ('.$dbatch->qty.')'; + $quantityToBeDelivered -= $deliverableQty; + if ($quantityToBeDelivered < 0) + { + $quantityToBeDelivered = 0; + } + //dol_syslog('deliverableQty = '.$deliverableQty.' batchStock = '.$batchStock); + $subj++; + print ''; + } + } + } } - print ''; + if ($subj == 0) // Line not shown yet, we show it + { + print ''; + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $disabled=''; + if (! empty($conf->productbatch->enabled) && $product->hasbatch()) + { + $disabled='disabled="disabled"'; + } + print ' '; + } + else + { + print $langs->trans("NA"); + } + print ''; + + print ''; + if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $warehouse_selected_id = GETPOST('entrepot_id', 'int'); + if ($warehouse_selected_id > 0) + { + $warehouseObject=new Entrepot($db); + $warehouseObject->fetch($warehouse_selected_id); + print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle); + } + else + { + if ($line->fk_product) print img_warning().' '.$langs->trans("StockTooLow"); + else print ''; + } + } + else + { + print $langs->trans("Service"); + } + print ''; + print ''; + } + } + + + //Display lines extrafields + if (is_array($extralabelslines) && count($extralabelslines)>0) + { + $colspan=5; + $orderLineExtrafields = new Extrafields($db); + $orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line); + $srcLine = new OrderLine($db); + $srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline + $line = new ExpeditionLigne($db); + //$line->fetch_optionals($line->id); + $line->array_options = array_merge($line->array_options, $srcLine->array_options); + print ''; + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); print ''; } - } - - //Display lines extrafields - if (is_array($extralabelslines) && count($extralabelslines)>0) - { - $colspan=5; - $orderLineExtrafields = new Extrafields($db); - $orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line); - $srcLine = new OrderLine($db); - $srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline - $line = new ExpeditionLigne($db); - //$line->fetch_optionals($line->id); - $line->array_options = array_merge($line->array_options, $srcLine->array_options); - print ''; - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); - print ''; - } - - $indiceAsked++; + $indiceAsked++; + } } print ""; @@ -1828,7 +1835,7 @@ elseif ($id || $ref) if ($totalWeight > 0) { if (!empty($object->trueWeight)) print ' ('.$langs->trans("SumOfProductWeights").': '; - //print $totalWeight.' '.measuring_units_string(0,"weight"); + //print $totalWeight.' '.measuring_units_string(0, "weight"); print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); //if (empty($object->trueWeight)) print ' ('.$langs->trans("Calculated").')'; if (!empty($object->trueWeight)) print ')'; @@ -1886,7 +1893,7 @@ elseif ($id || $ref) { if ($volumeUnit < 50) { - //print $calculatedVolume.' '.measuring_units_string($volumeUnit,"volume"); + //print $calculatedVolume.' '.measuring_units_string($volumeUnit, "volume"); print showDimensionInBestUnit($calculatedVolume, $volumeUnit, "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'); } else print $calculatedVolume.' '.measuring_units_string($volumeUnit, "volume"); @@ -1894,7 +1901,7 @@ elseif ($id || $ref) if ($totalVolume > 0) { if ($calculatedVolume) print ' ('.$langs->trans("SumOfProductVolumes").': '; - //print $totalVolume.' '.measuring_units_string(0,"volume"); + //print $totalVolume.' '.measuring_units_string(0, "volume"); 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'); //if (empty($calculatedVolume)) print ' ('.$langs->trans("Calculated").')'; if ($calculatedVolume) print ')'; @@ -1975,6 +1982,11 @@ elseif ($id || $ref) print ''; } + // Other attributes + $parameters = array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print ""; print ''; @@ -2129,298 +2141,306 @@ elseif ($id || $ref) // Loop on each product to send/sent for ($i = 0 ; $i < $num_prod ; $i++) { - print ''; // id of order line - print ''; + $parameters = array('i' => $i, 'line' => $lines[$i], 'line_id' => $line_id, 'num' => $num_prod, 'alreadysent' => $alreadysent, 'editColspan' => $editColspan, 'outputlangs' => $outputlangs); + $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); + if($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - // Adds a line numbering column - if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) + if(empty($reshook)) { - print ''.($i+1).''; - } + print ''; // id of order line + print ''; - // Predefined product or service - if ($lines[$i]->fk_product > 0) - { - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + // # + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - $prod = new Product($db); - $prod->fetch($lines[$i]->fk_product); - $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; + print ''.($i+1).''; + } + + // Predefined product or service + if ($lines[$i]->fk_product > 0) + { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $prod = new Product($db); + $prod->fetch($lines[$i]->fk_product); + $label = ( ! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; + } + else + $label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label); + + print ''; + + // Show product and description + $product_static->type=$lines[$i]->fk_product_type; + $product_static->id=$lines[$i]->fk_product; + $product_static->ref=$lines[$i]->ref; + $product_static->status_batch=$lines[$i]->product_tobatch; + $text=$product_static->getNomUrl(1); + $text.= ' - '.$label; + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->description)); + print $form->textwithtooltip($text, $description, 3, '', '', $i); + print_date_range($lines[$i]->date_start, $lines[$i]->date_end); + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($lines[$i]->description) && $lines[$i]->description!=$lines[$i]->product)?'
'.dol_htmlentitiesbr($lines[$i]->description):''; + } + print "\n"; } else - $label = (! empty($lines[$i]->label)?$lines[$i]->label:$lines[$i]->product_label); - - print ''; - - // Show product and description - $product_static->type=$lines[$i]->fk_product_type; - $product_static->id=$lines[$i]->fk_product; - $product_static->ref=$lines[$i]->ref; - $product_static->status_batch=$lines[$i]->product_tobatch; - $text=$product_static->getNomUrl(1); - $text.= ' - '.$label; - $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($lines[$i]->description)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); - print_date_range($lines[$i]->date_start, $lines[$i]->date_end); - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { - print (! empty($lines[$i]->description) && $lines[$i]->description!=$lines[$i]->product)?'
'.dol_htmlentitiesbr($lines[$i]->description):''; - } - print "\n"; - } - else - { - print ""; - if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); - else $text = img_object($langs->trans('Product'), 'product'); + print ""; + if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); + else $text = img_object($langs->trans('Product'), 'product'); - if (! empty($lines[$i]->label)) { - $text.= ' '.$lines[$i]->label.''; - print $form->textwithtooltip($text, $lines[$i]->description, 3, '', '', $i); - } else { - print $text.' '.nl2br($lines[$i]->description); - } - - print_date_range($lines[$i]->date_start, $lines[$i]->date_end); - print "\n"; - } - - // Qty ordered - print ''.$lines[$i]->qty_asked.''; - - // Qty in other shipments (with shipment and warehouse used) - if ($origin && $origin_id > 0) - { - print ''; - foreach ($alreadysent as $key => $val) - { - if ($lines[$i]->fk_origin_line == $key) - { - $j = 0; - foreach($val as $shipmentline_id=> $shipmentline_var) - { - if ($shipmentline_var['shipment_id'] == $lines[$i]->fk_expedition) continue; // We want to show only "other shipments" - - $j++; - if ($j > 1) print '
'; - $shipment_static->fetch($shipmentline_var['shipment_id']); - print $shipment_static->getNomUrl(1); - print ' - '.$shipmentline_var['qty_shipped']; - $htmltext=$langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid'])?$langs->trans("Draft"):dol_print_date($shipmentline_var['date_valid'], 'dayhour')); - if (! empty($conf->stock->enabled) && $shipmentline_var['warehouse'] > 0) - { - $warehousestatic->fetch($shipmentline_var['warehouse']); - $htmltext .= '
'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1); - } - print ' '.$form->textwithpicto('', $htmltext, 1); - } - } - } - } - print ''; - - if ($action == 'editline' && $lines[$i]->id == $line_id) - { - // edit mode - print ''; - if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) - { - print ''; - $line = new ExpeditionLigne($db); - foreach ($lines[$i]->detail_batch as $detail_batch) - { - print ''; - // Qty to ship or shipped - print ''; - // Batch number managment - if ($lines[$i]->entrepot_id == 0) - { - // only show lot numbers from src warehouse when shipping from multiple warehouses - $line->fetch($detail_batch->fk_expeditiondet); - } - print ''; - print ''; + if (! empty($lines[$i]->label)) { + $text.= ' '.$lines[$i]->label.''; + print $form->textwithtooltip($text, $lines[$i]->description, 3, '', '', $i); + } else { + print $text.' '.nl2br($lines[$i]->description); } - // add a 0 qty lot row to be able to add a lot - print ''; - // Qty to ship or shipped - print ''; - // Batch number managment - print ''; - print ''; + + print_date_range($lines[$i]->date_start, $lines[$i]->date_end); + print "\n"; } - elseif (! empty($conf->stock->enabled)) + + // Qty ordered + print ''; + + // Qty in other shipments (with shipment and warehouse used) + if ($origin && $origin_id > 0) + { + print ''; + + if ($action == 'editline' && $lines[$i]->id == $line_id) { - if ($lines[$i]->fk_product > 0) + // edit mode + print ''; - } - else - { - // Qty to ship or shipped - print ''; - // Warehouse source - if (! empty($conf->stock->enabled)) - { - print ''; - } - - // Batch number managment - if (! empty($conf->productbatch->enabled)) - { - if (isset($lines[$i]->detail_batch)) - { - print ''; - print ''; - } else { - print ''; - } - } - } - - // Weight - print ''; - - // Volume - print ''; - - // Size - //print ''; - - if ($action == 'editline' && $lines[$i]->id == $line_id) - { - print ''; - print ''; - - // Display lines extrafields - if (! empty($rowExtrafieldsStart)) - { - print $rowExtrafieldsStart; - print $rowExtrafieldsView; - print $rowEnd; - } - } - print ""; - - // Display lines extrafields - if (is_array($extralabelslines) && count($extralabelslines)>0) { - $colspan= empty($conf->productbatch->enabled) ? 5 : 6; - $line = new ExpeditionLigne($db); - $line->fetch_optionals($lines[$i]->id); - print ''; - if ($action == 'editline' && $lines[$i]->id == $line_id) - { - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); + print '
' . '' . '' . $formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id). '
' . '' . '' . $formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product). '
'.$lines[$i]->qty_asked.''; + foreach ($alreadysent as $key => $val) + { + if ($lines[$i]->fk_origin_line == $key) + { + $j = 0; + foreach($val as $shipmentline_id=> $shipmentline_var) + { + if ($shipmentline_var['shipment_id'] == $lines[$i]->fk_expedition) continue; // We want to show only "other shipments" + + $j++; + if ($j > 1) print '
'; + $shipment_static->fetch($shipmentline_var['shipment_id']); + print $shipment_static->getNomUrl(1); + print ' - '.$shipmentline_var['qty_shipped']; + $htmltext=$langs->trans("DateValidation").' : '.(empty($shipmentline_var['date_valid'])?$langs->trans("Draft"):dol_print_date($shipmentline_var['date_valid'], 'dayhour')); + if (! empty($conf->stock->enabled) && $shipmentline_var['warehouse'] > 0) + { + $warehousestatic->fetch($shipmentline_var['warehouse']); + $htmltext .= '
'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1); + } + print ' '.$form->textwithpicto('', $htmltext, 1); + } + } + } + } + print '
'; + if (is_array($lines[$i]->detail_batch) && count($lines[$i]->detail_batch) > 0) { - if ($lines[$i]->entrepot_id > 0) + print ''; + $line = new ExpeditionLigne($db); + foreach ($lines[$i]->detail_batch as $detail_batch) { - print ''; print ''; // Qty to ship or shipped - print ''; - // Warehouse source - print ''; + print ''; // Batch number managment - print ''; + if ($lines[$i]->entrepot_id == 0) + { + // only show lot numbers from src warehouse when shipping from multiple warehouses + $line->fetch($detail_batch->fk_expeditiondet); + } + print ''; print ''; } - elseif (count($lines[$i]->details_entrepot) > 1) + // add a 0 qty lot row to be able to add a lot + print ''; + // Qty to ship or shipped + print ''; + // Batch number managment + print ''; + print ''; + } + elseif (! empty($conf->stock->enabled)) + { + if ($lines[$i]->fk_product > 0) { - print ''; - foreach ($lines[$i]->details_entrepot as $detail_entrepot) + if ($lines[$i]->entrepot_id > 0) { + print ''; print ''; // Qty to ship or shipped - print ''; + print ''; // Warehouse source - print ''; + print ''; // Batch number managment print ''; print ''; } + elseif (count($lines[$i]->details_entrepot) > 1) + { + print ''; + foreach ($lines[$i]->details_entrepot as $detail_entrepot) + { + print ''; + // Qty to ship or shipped + print ''; + // Warehouse source + print ''; + // Batch number managment + print ''; + print ''; + } + } + else + { + print ''; + print ''; + } } else { - print ''; - print ''; + print ''; + print ''; + // Qty to ship or shipped + print ''; + // Warehouse source + print ''; + // Batch number managment + print ''; + print ''; } } - else - { - print ''; - print ''; - // Qty to ship or shipped - print ''; - // Warehouse source - print ''; - // Batch number managment - print ''; - print ''; - } - } - print '
' . '' . '' . $formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). '' . '' . ' - ' . $langs->trans("NA") . '' . $formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id). '
' . '' . '' . $formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product). '
' . '' . '' . '' . '' . $formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1) . '' . $formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). ' - ' . $langs->trans("NA") . '
' . '' . '' . $formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1) . ' - ' . $langs->trans("NA") . '
'.$langs->trans("NotEnoughStock").'
'.$langs->trans("NotEnoughStock").'
' . '' . '' . '' . '
' . '' . '' . '' . '
'.$lines[$i]->qty_shipped.''; - if ($lines[$i]->entrepot_id > 0) - { - $entrepot = new Entrepot($db); - $entrepot->fetch($lines[$i]->entrepot_id); - print $entrepot->getNomUrl(1); - } - elseif (count($lines[$i]->details_entrepot) > 1) - { - $detail = ''; - foreach ($lines[$i]->details_entrepot as $detail_entrepot) - { - if ($detail_entrepot->entrepot_id > 0) - { - $entrepot = new Entrepot($db); - $entrepot->fetch($detail_entrepot->entrepot_id); - $detail.= $langs->trans("DetailWarehouseFormat", $entrepot->libelle, $detail_entrepot->qty_shipped).'
'; - } - } - print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans("DetailWarehouseNumber"), $detail); - } - print '
'; - if ($lines[$i]->product_tobatch) - { - $detail = ''; - foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch - { - $detail.= $langs->trans("Batch").': '.$dbatch->batch; - $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); - $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); - $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; - $detail.= '
'; - } - print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); - } - else - { - print $langs->trans("NA"); - } - print '
'; - if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units, "weight"); - else print ' '; - print ''; - if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume"); - else print ' '; - print ''.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units,"volume").''; - print '
'; - print '
'; - } - elseif ($object->statut == 0) - { - // edit-delete buttons - print '
'; - print 'id . '">' . img_edit() . ''; - print ''; - print 'id . '">' . img_delete() . ''; - print '
'; } else { - print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); + // Qty to ship or shipped + print ''.$lines[$i]->qty_shipped.''; + + // Warehouse source + if (! empty($conf->stock->enabled)) + { + print ''; + if ($lines[$i]->entrepot_id > 0) + { + $entrepot = new Entrepot($db); + $entrepot->fetch($lines[$i]->entrepot_id); + print $entrepot->getNomUrl(1); + } + elseif (count($lines[$i]->details_entrepot) > 1) + { + $detail = ''; + foreach ($lines[$i]->details_entrepot as $detail_entrepot) + { + if ($detail_entrepot->entrepot_id > 0) + { + $entrepot = new Entrepot($db); + $entrepot->fetch($detail_entrepot->entrepot_id); + $detail.= $langs->trans("DetailWarehouseFormat", $entrepot->libelle, $detail_entrepot->qty_shipped).'
'; + } + } + print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans("DetailWarehouseNumber"), $detail); + } + print ''; + } + + // Batch number managment + if (! empty($conf->productbatch->enabled)) + { + if (isset($lines[$i]->detail_batch)) + { + print ''; + print ''; + if ($lines[$i]->product_tobatch) + { + $detail = ''; + foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch + { + $detail.= $langs->trans("Batch").': '.$dbatch->batch; + $detail.= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); + $detail.= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); + $detail.= ' - '.$langs->trans("Qty").': '.$dbatch->qty; + $detail.= '
'; + } + print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); + } + else + { + print $langs->trans("NA"); + } + print ''; + } else { + print ''; + } + } + } + + // Weight + print ''; + if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->weight*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->weight_units, "weight"); + else print ' '; + print ''; + + // Volume + print ''; + if ($lines[$i]->fk_product_type == Product::TYPE_PRODUCT) print $lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume"); + else print ' '; + print ''; + + // Size + //print ''.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units, "volume").''; + + if ($action == 'editline' && $lines[$i]->id == $line_id) + { + print ''; + print '
'; + print '
'; + } + elseif ($object->statut == 0) + { + // edit-delete buttons + print ''; + print 'id . '">' . img_edit() . ''; + print ''; + print ''; + print 'id . '">' . img_delete() . ''; + print ''; + + // Display lines extrafields + if (! empty($rowExtrafieldsStart)) + { + print $rowExtrafieldsStart; + print $rowExtrafieldsView; + print $rowEnd; + } + } + print ""; + + // Display lines extrafields + if (is_array($extralabelslines) && count($extralabelslines)>0) { + $colspan= empty($conf->productbatch->enabled) ? 5 : 6; + $line = new ExpeditionLigne($db); + $line->fetch_optionals($lines[$i]->id); + print ''; + if ($action == 'editline' && $lines[$i]->id == $line_id) + { + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); + } + else + { + print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); + } + print ''; } - print ''; } } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 202808d5d58..4acb2fce932 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -123,7 +123,7 @@ elseif ($action == 'deletecontact' && $user->rights->expedition->creer) } } /* -else if ($action == 'setaddress' && $user->rights->expedition->creer) +elseif ($action == 'setaddress' && $user->rights->expedition->creer) { $object->fetch($id); $result=$object->setDeliveryAddress($_POST['fk_address']); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 50c67354dde..d9b2537e4ba 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -44,9 +44,12 @@ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) requi // Load translation files required by the page $langs->loadLangs(array('orders',"companies","bills",'propal','deliveries','stocks',"productbatch",'incoterm')); -$id=GETPOST('id', 'int'); // id of order -$ref= GETPOST('ref', 'alpha'); -$action=GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); // id of order +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action', 'alpha'); + +$hookmanager->initHooks(array('ordershipmentcard')); + // Security check $socid=0; @@ -612,6 +615,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " cd.qty,"; $sql.= ' cd.date_start,'; $sql.= ' cd.date_end,'; + $sql.= ' cd.special_code,'; $sql.= ' p.rowid as prodid, p.label as product_label, p.entity, p.ref, p.fk_product_type as product_type, p.description as product_desc'; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; @@ -647,164 +651,169 @@ if ($id > 0 || ! empty($ref)) { $objp = $db->fetch_object($resql); + $parameters = array('i' => $i, 'line' => $objp, 'num' => $num); + $reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - // Show product and description - $type=isset($objp->type)?$objp->type:$objp->product_type; - - // Try to enhance type detection using date_start and date_end for free lines where type - // was not saved. - if (! empty($objp->date_start)) $type=1; - if (! empty($objp->date_end)) $type=1; - - print ''; - - // Product label - if ($objp->fk_product > 0) + if (empty($reshook)) { - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + // Show product and description + $type=isset($objp->type)?$objp->type:$objp->product_type; + + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (! empty($objp->date_start)) $type=1; + if (! empty($objp->date_end)) $type=1; + + print ''; + + // Product label + if ($objp->fk_product > 0) { - $object->fetch_thirdparty(); - - $prod = new Product($db); - $prod->id = $objp->fk_product; - $prod->entity = $objp->entity; - $prod->getMultiLangs(); - - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if (empty($newlang)) $newlang=$object->thirdparty->default_lang; - if (! empty($newlang)) + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); + $object->fetch_thirdparty(); + + $prod = new Product($db); + $prod->id = $objp->fk_product; + $prod->entity = $objp->entity; + $prod->getMultiLangs(); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if (empty($newlang)) $newlang=$object->thirdparty->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + } + else + $label = (! empty($objp->label)?$objp->label:$objp->product_label); + + print ''; + print ''; // ancre pour retourner sur la ligne + + // Show product and description + $product_static->type=$type; + $product_static->id=$objp->fk_product; + $product_static->ref=$objp->ref; + $product_static->entity = $objp->entity; + $text=$product_static->getNomUrl(1); + $text.= ' - '.$label; + $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'
'; + $description.= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); + 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 ($objp->description && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } - $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + print ''; } else - $label = (! empty($objp->label)?$objp->label:$objp->product_label); - - print ''; - print ''; // ancre pour retourner sur la ligne - - // Show product and description - $product_static->type=$type; - $product_static->id=$objp->fk_product; - $product_static->ref=$objp->ref; - $product_static->entity = $objp->entity; - $text=$product_static->getNomUrl(1); - $text.= ' - '.$label; - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'
'; - $description.= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); - 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 ($objp->description && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + print ""; + if ($type==1) $text = img_object($langs->trans('Service'), 'service'); + else $text = img_object($langs->trans('Product'), 'product'); + + if (! empty($objp->label)) { + $text.= ' '.$objp->label.''; + print $form->textwithtooltip($text, $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 "\n"; } - print ''; - } - else - { - print ""; - if ($type==1) $text = img_object($langs->trans('Service'), 'service'); - else $text = img_object($langs->trans('Product'), 'product'); + // Qty ordered + print '' . $objp->qty . ''; - if (! empty($objp->label)) { - $text.= ' '.$objp->label.''; - print $form->textwithtooltip($text, $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 "\n"; - } - - // Qty ordered - print '' . $objp->qty . ''; - - // Qty already shipped - $qtyProdCom=$objp->qty; - print ''; - // Nb of sending products for this line of order - $qtyAlreadyShipped = (! empty($object->expeditions[$objp->rowid])?$object->expeditions[$objp->rowid]:0); - print $qtyAlreadyShipped; - print ''; - - // Qty remains to ship - print ''; - if ($type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) - { - $toBeShipped[$objp->fk_product] = $objp->qty - $qtyAlreadyShipped; - $toBeShippedTotal += $toBeShipped[$objp->fk_product]; - print $toBeShipped[$objp->fk_product]; - } - else - { - print '0 ('.$langs->trans("Service").')'; - } - print ''; - - if ($objp->fk_product > 0) - { - $product = new Product($db); - $product->fetch($objp->fk_product); - $product->load_stock('warehouseopen'); - } - - if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) && ! empty($conf->stock->enabled)) - { + // Qty already shipped + $qtyProdCom=$objp->qty; print ''; - print $product->stock_reel; - if ($product->stock_reel < $toBeShipped[$objp->fk_product]) + // Nb of sending products for this line of order + $qtyAlreadyShipped = (! empty($object->expeditions[$objp->rowid])?$object->expeditions[$objp->rowid]:0); + print $qtyAlreadyShipped; + print ''; + + // Qty remains to ship + print ''; + if ($type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print ' '.img_warning($langs->trans("StockTooLow")); + $toBeShipped[$objp->fk_product] = $objp->qty - $qtyAlreadyShipped; + $toBeShippedTotal += $toBeShipped[$objp->fk_product]; + print $toBeShipped[$objp->fk_product]; + } + else + { + print '0 ('.$langs->trans("Service").')'; } print ''; - } - else - { - print ' '; - } - print "\n"; - // Show subproducts lines - if ($objp->fk_product > 0 && ! empty($conf->global->PRODUIT_SOUSPRODUITS)) - { - // Set tree of subproducts in product->sousprods - $product->get_sousproduits_arbo(); - //var_dump($product->sousprods);exit; - - // Define a new tree with quantiies recalculated - $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); - //var_dump($prods_arbo); - if (count($prods_arbo) > 0) + if ($objp->fk_product > 0) { - foreach($prods_arbo as $key => $value) + $product = new Product($db); + $product->fetch($objp->fk_product); + $product->load_stock('warehouseopen'); + } + + if ($objp->fk_product > 0 && ($type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) && ! empty($conf->stock->enabled)) + { + print ''; + print $product->stock_reel; + if ($product->stock_reel < $toBeShipped[$objp->fk_product]) { - $img=''; - if ($value['stock'] < $value['stock_alert']) + print ' '.img_warning($langs->trans("StockTooLow")); + } + print ''; + } + else + { + print ' '; + } + print "\n"; + + // Show subproducts lines + if ($objp->fk_product > 0 && ! empty($conf->global->PRODUIT_SOUSPRODUITS)) + { + // Set tree of subproducts in product->sousprods + $product->get_sousproduits_arbo(); + //var_dump($product->sousprods);exit; + + // Define a new tree with quantiies recalculated + $prods_arbo = $product->get_arbo_each_prod($qtyProdCom); + //var_dump($prods_arbo); + if (count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) { - $img=img_warning($langs->trans("StockTooLow")); + $img=''; + if ($value['stock'] < $value['stock_alert']) + { + $img=img_warning($langs->trans("StockTooLow")); + } + print '      -> '.$value['fullpath'].' ('.$value['nb'].')'; + print ' '.$value['nb_total'].''; + print ' '; + print ' '; + print ''.$value['stock'].' '.$img.''."\n"; } - print '      -> '.$value['fullpath'].' ('.$value['nb'].')'; - print ' '.$value['nb_total'].''; - print ' '; - print ' '; - print ''.$value['stock'].' '.$img.''."\n"; } } } - $i++; } $db->free($resql); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index c6d87acef4d..c39b67a8680 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -66,7 +66,7 @@ $socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('socid_id', 'in // Security check $id=GETPOST("id", 'int'); if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'expensereport', 0, 'expensereport'); +$result = restrictedArea($user, 'expensereport', $id, 'expensereport'); // Hack to use expensereport dir @@ -1892,9 +1892,9 @@ else print '' . $langs->trans('Date') . ''; print '' . $langs->trans('Type') . ''; if (! empty($conf->banque->enabled)) { - print '' . $langs->trans('BankAccount') . ''; + print '' . $langs->trans('BankAccount') . ''; } - print '' . $langs->trans('Amount') . ''; + print '' . $langs->trans('Amount') . ''; print ' '; print ''; @@ -1948,12 +1948,12 @@ else $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); } - print ''; + print ''; if ($bankaccountstatic->id) print $bankaccountstatic->getNomUrl(1, 'transactions'); print ''; } - print ''.price($objp->amount).""; + print ''.price($objp->amount).""; print ''; print ""; $totalpaid += $objp->amount; @@ -1975,10 +1975,10 @@ else { $cssforamountpaymentcomplete = 'amountpaymentneutral'; } - print ''.$langs->trans("AlreadyPaid").':'.price($totalpaid).''; - print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; + print ''.$langs->trans("AlreadyPaid").':'.price($totalpaid).''; + print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; - print ''.$langs->trans("RemainderToPay").':'; + print ''.$langs->trans("RemainderToPay").':'; print ''.price($resteapayeraffiche).''; $db->free($resql); @@ -2014,26 +2014,26 @@ else $i = 0;$total = 0; print ''; - print ''.$langs->trans('LineNb').''; - //print ''.$langs->trans('Piece').''; - print ''.$langs->trans('Date').''; + print ''.$langs->trans('LineNb').''; + //print ''.$langs->trans('Piece').''; + print ''.$langs->trans('Date').''; if (! empty($conf->projet->enabled)) print ''.$langs->trans('Project').''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print ''.$langs->trans('CarCategory').''; - print ''.$langs->trans('Type').''; - print ''.$langs->trans('Description').''; - print ''.$langs->trans('VAT').''; - print ''.$langs->trans('PriceUHT').''; - print ''.$langs->trans('PriceUTTC').''; - print ''.$langs->trans('Qty').''; + print ''.$langs->trans('Type').''; + print ''.$langs->trans('Description').''; + print ''.$langs->trans('VAT').''; + print ''.$langs->trans('PriceUHT').''; + print ''.$langs->trans('PriceUTTC').''; + print ''.$langs->trans('Qty').''; if ($action != 'editline') { - print ''.$langs->trans('AmountHT').''; - print ''.$langs->trans('AmountTTC').''; + print ''.$langs->trans('AmountHT').''; + print ''.$langs->trans('AmountTTC').''; } // Ajout des boutons de modification/suppression if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer) { - print ''; + print ''; } print ''; @@ -2045,22 +2045,22 @@ else { print ''; - print ''; + print ''; print $numline; print ''; - /*print ''; + /*print ''; print img_picto($langs->trans("Document"), "object_generic"); print ' '.$piece_comptable.''; print '';*/ - print ''.dol_print_date($db->jdate($line->date), 'day').''; + print ''.dol_print_date($db->jdate($line->date), 'day').''; if (! empty($conf->projet->enabled)) { print ''; - if ($line->fk_projet > 0) + if ($line->fk_project > 0) { - $projecttmp->id=$line->fk_projet; + $projecttmp->id=$line->fk_project; $projecttmp->ref=$line->projet_ref; print $projecttmp->getNomUrl(1); } @@ -2076,10 +2076,10 @@ else $labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code)); print $labeltype; print ''; - print ''.dol_escape_htmltag($line->comments).''; - print ''.vatrate($line->vatrate, true).''; + print ''.dol_nl2br($line->comments).''; + print ''.vatrate($line->vatrate, true).''; // Unit price HT - print ''; + print ''; if (! empty($line->value_unit_ht)) { print price($line->value_unit_ht); @@ -2092,20 +2092,20 @@ else } print ''; - print ''.price($line->value_unit).''; + print ''.price($line->value_unit).''; - print ''.dol_escape_htmltag($line->qty).''; + print ''.dol_escape_htmltag($line->qty).''; if ($action != 'editline') { - print ''.price($line->total_ht).''; - print ''.price($line->total_ttc).''; + print ''.price($line->total_ht).''; + print ''.price($line->total_ttc).''; } // Ajout des boutons de modification/suppression if (($object->fk_statut < ExpenseReport::STATUS_VALIDATED || $object->fk_statut == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) { - print ''; + print ''; print 'rowid.'#'.$line->rowid.'">'; print img_edit(); @@ -2135,7 +2135,7 @@ else if (! empty($conf->projet->enabled)) { print ''; - $formproject->select_projects(-1, $line->fk_projet, 'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + $formproject->select_projects(-1, $line->fk_project, 'fk_projet', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; } @@ -2154,36 +2154,36 @@ else // Add comments print ''; - print ''; + print ''; print ''; // VAT - print ''; + print ''; print $form->load_tva('vatrate', (isset($_POST["vatrate"])?$_POST["vatrate"]:$line->vatrate), $mysoc, '', 0, 0, '', false, 1); print ''; // Unit price - print ''; + print ''; print ''; print ''; // Unit price with tax - print ''; + print ''; print ''; print ''; // Quantity - print ''; + print ''; print ''; print ''; if ($action != 'editline') { - print ''.$langs->trans('AmountHT').''; - print ''.$langs->trans('AmountTTC').''; + print ''.$langs->trans('AmountHT').''; + print ''.$langs->trans('AmountTTC').''; } - print ''; + print ''; print ''; print ''; print '
'; @@ -2202,12 +2202,54 @@ else if (! empty($conf->projet->enabled)) $colspan++; if ($action != 'editline') $colspan++; + $nbFiles = $nbLinks = 0; + $arrayoffiles = array(); + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref); + $arrayoffiles=dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); + $nbFiles = count($arrayoffiles); + $nbLinks=Link::count($db, $object->element, $object->id); + } + + // Add line with link to add new file or attach to an existing file print ''; print ''; - print $langs->trans("UploadANewFileNow"); + print '
'.$langs->trans("UploadANewFileNow"); + print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + print '   -   '.''.$langs->trans("AttachTheNewLineToTheDocument"); + print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + } + + print ''."\n"; print ''; - print ''; + // Add line to upload new file + print 'global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>'; print ''; $modulepart = 'expensereport'; @@ -2251,17 +2293,76 @@ else print ''; + // Add line to select existing file + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->expensereport->dir_output . "/" . dol_sanitizeFileName($object->ref); + $arrayoffiles=dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); + $nbFiles = count($arrayoffiles); + $nbLinks=Link::count($db, $object->element, $object->id); + if ($nbFiles >= 0) + { + print 'global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display: none"':'').'>'; + print ''; + //print ''.$langs->trans("AttachTheNewLineToTheDocument").'
'; + $modulepart='expensereport';$maxheightmini=48; + $relativepath=(! empty($object->ref)?dol_sanitizeFileName($object->ref):'').'/'; + foreach($arrayoffiles as $file) + { + print '
'; + $fileinfo = pathinfo($file['name']); + if (image_format_supported($file['name']) > 0) + { + $minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original + //if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension + //print $file['path'].'/'.$minifile.'
'; + $urlforhref=getAdvancedPreviewUrl($modulepart, $fileinfo['relativename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity)?$object->entity:$conf->entity)); + if (empty($urlforhref)) { + $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($fileinfo['relativename'].'.'.strtolower($fileinfo['extension'])); + print ''; + } else { + print ''; + } + print ''; + print ''; + } + else print ' '; + print '
'; + $checked=''; + //var_dump(GETPOST($file['relativename'])); var_dump($file['relativename']); var_dump($_FILES['userfile']['name']); + foreach($_FILES['userfile']['name'] as $tmpfile) + { + if ($file['relativename'] == (GETPOST('savingdocmask', 'alpha') ? dol_sanitizeFileName($object->ref.'-') : '').$tmpfile) + { + $checked=' checked'; + break; + } + elseif ($file['relativename'] && in_array($file['relativename'], GETPOST('attachfile', 'array'))) { + $checked=' checked'; + break; + } + } + print ' '.$file['relativename']; + print '
'; + } + print ''; + } + } + print ''; print ''; - print ''.$langs->trans('Date').''; + print ''.$langs->trans('Date').''; if (! empty($conf->projet->enabled)) print ''.$langs->trans('Project').''; if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) print ''.$langs->trans('CarCategory').''; - print ''.$langs->trans('Type').''; + print ''.$langs->trans('Type').''; print ''.$langs->trans('Description').''; - print ''.$langs->trans('VAT').''; - print ''.$langs->trans('PriceUHT').''; - print ''.$langs->trans('PriceUTTC').''; - print ''.$langs->trans('Qty').''; + print ''.$langs->trans('VAT').''; + print ''.$langs->trans('PriceUHT').''; + print ''.$langs->trans('PriceUTTC').''; + print ''.$langs->trans('Qty').''; print ''; print ''; @@ -2271,7 +2372,7 @@ else print ''; // Select date - print ''; + print ''; print $form->selectDate($date?$date:-1, 'date', 0, 0, 0, '', 1, 1); print ''; @@ -2292,56 +2393,46 @@ else } // Select type - print ''; + print ''; select_type_fees_id($fk_c_type_fees, 'fk_c_type_fees', 1); print ''; // Add comments print ''; - print ''; + print ''; print ''; // Select VAT - print ''; + print ''; $defaultvat=-1; if (! empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; print $form->load_tva('vatrate', ($vatrate!=''?$vatrate:$defaultvat), $mysoc, '', 0, 0, '', false, 1); print ''; // Unit price net - print ''; + print ''; print ''; print ''; // Unit price with tax - print ''; + print ''; print ''; print ''; // Quantity - print ''; + print ''; print ''; // We must be able to enter decimal qty print ''; if ($action != 'editline') { - print ''; - print ''; + print ''; + print ''; } - print ''; + print ''; print ''; - - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) - { - print ''; - print $langs->trans("AttachTheNewLineToTheDocument"); - - print '...'; - - print ''; - } } // Fin si c'est payé/validé print ''; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 48902b45ca8..0bc5c533f9e 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -856,12 +856,12 @@ class ExpenseReport extends CommonObject print ''; print ''.$objp->ref_num.''; - print ''.dol_print_date($objp->date, 'day').''; + print ''.dol_print_date($objp->date, 'day').''; print ''.$author->getNomUrl(1).''; print ''.$objp->comments.''; - print ''.price($objp->total_ht).''; - print ''.price($objp->total_ttc).''; - print ''; + print ''.price($objp->total_ht).''; + print ''.price($objp->total_ttc).''; + print ''; switch($objp->fk_c_expensereport_status) { case 4: @@ -895,8 +895,8 @@ class ExpenseReport extends CommonObject } print ''.$langs->trans("Number").': '.$i.''; - print ''.$langs->trans("TotalHT").' : '.price($total_HT).''; - print ''.$langs->trans("TotalTTC").' : '.price($total_TTC).''; + print ''.$langs->trans("TotalHT").' : '.price($total_HT).''; + print ''.$langs->trans("TotalTTC").' : '.price($total_TTC).''; print ' '; print ''; } @@ -971,7 +971,7 @@ class ExpenseReport extends CommonObject $this->lines=array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; - $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet, de.tva_tx,'; + $sql.= ' de.'.$this->fk_element.', de.fk_c_type_fees, de.fk_c_exp_tax_cat, de.fk_projet as fk_project, de.tva_tx,'; $sql.= ' de.total_ht, de.total_tva, de.total_ttc,'; $sql.= ' ctf.code as code_type_fees, ctf.label as libelle_type_fees,'; $sql.= ' p.ref as ref_projet, p.title as title_projet'; @@ -1010,7 +1010,8 @@ class ExpenseReport extends CommonObject $deplig->fk_expensereport = $objp->fk_expensereport; $deplig->fk_c_type_fees = $objp->fk_c_type_fees; $deplig->fk_c_exp_tax_cat = $objp->fk_c_exp_tax_cat; - $deplig->fk_projet = $objp->fk_projet; + $deplig->fk_projet = $objp->fk_project; + $deplig->fk_project = $objp->fk_project; $deplig->total_ht = $objp->total_ht; $deplig->total_tva = $objp->total_tva; @@ -1994,7 +1995,8 @@ class ExpenseReport extends CommonObject $this->line->fk_expensereport= $expensereport_id; $this->line->fk_c_type_fees = $type_fees_id; $this->line->fk_c_exp_tax_cat = $fk_c_exp_tax_cat; - $this->line->fk_projet = $projet_id; + $this->line->fk_projet = $projet_id; // deprecated + $this->line->fk_project = $projet_id; $this->line->vat_src_code = $vat_src_code; $this->line->vatrate = price2num($vatrate); @@ -2513,7 +2515,7 @@ class ExpenseReportLine */ public function fetch($rowid) { - $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet, fde.date,'; + $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet as fk_project, fde.date,'; $sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' ctf.code as type_fees_code, ctf.label as type_fees_libelle,'; $sql.= ' pjt.rowid as projet_id, pjt.title as projet_title, pjt.ref as projet_ref'; @@ -2539,7 +2541,8 @@ class ExpenseReportLine $this->value_unit = $objp->value_unit; $this->fk_c_type_fees = $objp->fk_c_type_fees; $this->fk_c_exp_tax_cat = $objp->fk_c_exp_tax_cat; - $this->fk_projet = $objp->fk_projet; + $this->fk_projet = $objp->fk_project; // deprecated + $this->fk_project = $objp->fk_project; $this->type_fees_code = $objp->type_fees_code; $this->type_fees_libelle = $objp->type_fees_libelle; $this->projet_ref = $objp->projet_ref; @@ -2585,7 +2588,7 @@ class ExpenseReportLine $sql.= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat)'; $sql.= " VALUES (".$this->db->escape($this->fk_expensereport).","; $sql.= " ".$this->db->escape($this->fk_c_type_fees).","; - $sql.= " ".$this->db->escape($this->fk_projet>0?$this->fk_projet:'null').","; + $sql.= " ".$this->db->escape($this->fk_project>0?$this->fk_project:($this->fk_projet>0?$this->fk_projet:'null')).","; $sql.= " ".$this->db->escape($this->vatrate).","; $sql.= " '".$this->db->escape($this->vat_src_code)."',"; $sql.= " '".$this->db->escape($this->comments)."',"; @@ -2713,7 +2716,7 @@ class ExpenseReportLine $sql.= ",fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat); if ($this->fk_c_type_fees) $sql.= ",fk_c_type_fees=".$this->db->escape($this->fk_c_type_fees); else $sql.= ",fk_c_type_fees=null"; - if ($this->fk_projet) $sql.= ",fk_projet=".$this->db->escape($this->fk_projet); + if ($this->fk_project > 0) $sql.= ",fk_projet=".$this->db->escape($this->fk_project); else $sql.= ",fk_projet=null"; $sql.= " WHERE rowid = ".$this->db->escape($this->rowid); diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index bfe5bc59126..f7d4e2a8405 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -122,7 +122,7 @@ foreach ($listoftype as $code => $label) if ($conf->use_javascript_ajax) { - print ''; + print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); @@ -139,7 +139,7 @@ if ($conf->use_javascript_ajax) print ''; print ''.$langs->trans("Total").''; -print ''.price($totalsum, 1, $langs, 0, 0, 0, $conf->currency).''; +print ''.price($totalsum, 1, $langs, 0, 0, 0, $conf->currency).''; print ''; print ''; @@ -183,9 +183,9 @@ if ($result) print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; if ($num) @@ -208,10 +208,10 @@ if ($result) print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index c59b6d70e0f..c221baf7d65 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -556,16 +556,16 @@ if ($resql) // Amount with no tax if (! empty($arrayfields['d.total_ht']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['d.total_vat']['checked'])) { - print ''; + print ''; } // Amount with all taxes if (! empty($arrayfields['d.total_ttc']['checked'])) { - print ''; + print ''; } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -589,12 +589,12 @@ if ($resql) // Status if (! empty($arrayfields['d.fk_statut']['checked'])) { - print ''; } // Action column - print ''; @@ -670,7 +670,7 @@ if ($resql) print ''; } print ''; - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // End date if (! empty($arrayfields['d.date_fin']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Date validation if (! empty($arrayfields['d.date_valid']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Date approval if (! empty($arrayfields['d.date_approve']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Amount HT if (! empty($arrayfields['d.total_ht']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield']; $totalarray['totalht'] += $obj->total_ht; @@ -725,7 +725,7 @@ if ($resql) // Amount VAT if (! empty($arrayfields['d.total_vat']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield']; $totalarray['totalvat'] += $obj->total_tva; @@ -733,7 +733,7 @@ if ($resql) // Amount TTC if (! empty($arrayfields['d.total_ttc']['checked'])) { - print '\n"; + print '\n"; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; $totalarray['totalttc'] += $obj->total_ttc; @@ -748,7 +748,7 @@ if ($resql) // Date creation if (! empty($arrayfields['d.date_create']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; @@ -756,7 +756,7 @@ if ($resql) // Date modification if (! empty($arrayfields['d.tms']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; @@ -764,11 +764,11 @@ if ($resql) // Status if (! empty($arrayfields['d.fk_statut']['checked'])) { - print ''; + print ''; if (! $i) $totalarray['nbfield']++; } // Action column - print ''; else print ''; } - elseif ($totalarray['totalhtfield'] == $i) print ''; - elseif ($totalarray['totalvatfield'] == $i) print ''; - elseif ($totalarray['totalttcfield'] == $i) print ''; + elseif ($totalarray['totalhtfield'] == $i) print ''; + elseif ($totalarray['totalvatfield'] == $i) print ''; + elseif ($totalarray['totalttcfield'] == $i) print ''; else print ''; } print ''; diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 83de49358bc..73da11f4619 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -229,10 +229,10 @@ if ($resql) print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; if ($num > 0) @@ -252,16 +252,16 @@ if ($resql) print "\n"; // Expected to pay - print ''; + print ''; // Amount paid - print ''; + print ''; // Remain to pay - print ''; + print ''; // Status - print ''; + print ''; print "\n"; diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index cda372317ab..d95edae6450 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -289,10 +289,10 @@ if ($action == 'create' || empty($action)) print '
'.$langs->trans("BoxTitleLastModifiedExpenses", min($max, $num)).''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' 
'.$expensereportstatic->getNomUrl(1).''.$userstatic->getNomUrl(-1).''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->dm), 'day').''; + print ''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->dm), 'day').''; //print $obj->libelle; print $expensereportstatic->LibStatut($obj->fk_status, 3); print ''; + print ''; select_expensereport_statut($search_status, 'search_status', 1, 1); print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; + print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->expensereport->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -696,28 +696,28 @@ if ($resql) } // Start date if (! empty($arrayfields['d.date_debut']['checked'])) { - print ''.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').''.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').''.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').''.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').''.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').''.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').''.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').''.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').''.price($obj->total_ht)."'.price($obj->total_ht)."'.price($obj->total_tva)."'.price($obj->total_tva)."'.price($obj->total_ttc)."'.price($obj->total_ttc)."'; + print ''; print dol_print_date($db->jdate($obj->date_create), 'dayhour'); print ''; + print ''; print dol_print_date($db->jdate($obj->date_modif), 'dayhour'); print ''.$expensereportstatic->getLibStatut(5).''.$expensereportstatic->getLibStatut(5).''; + print ''; 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; @@ -808,9 +808,9 @@ if ($resql) if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).''.price($totalarray['totalht']).''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).'
'.$langs->trans('ExpenseReport').''.$langs->trans('ExpectedToPay').''.$langs->trans('PayedByThisPayment').''.$langs->trans('RemainderToPay').''.$langs->trans('Status').''.$langs->trans('ExpectedToPay').''.$langs->trans('PayedByThisPayment').''.$langs->trans('RemainderToPay').''.$langs->trans('Status').'
'.price($objp->total_ttc).''.price($objp->total_ttc).''.price($objp->amount).''.price($objp->amount).''.price($remaintopay).''.price($remaintopay).''.$expensereport->getLibStatut(4, $objp->amount).''.$expensereport->getLibStatut(4, $objp->amount).'
'; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; $total=0; @@ -304,10 +304,10 @@ if ($action == 'create' || empty($action)) print ''; - print '"; - print '"; - print '"; - print '"; + print '"; + print '"; + print ''; - print ''; - print ""; - print ""; - print ""; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index eb269d4f5f8..8980238c07b 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -242,7 +242,7 @@ if (! in_array($year, $arrayyears)) $arrayyears[$year]=$year; arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print '
'.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").'
'.price($objp->total_ttc)."'.price($sumpaid)."'.price($objp->total_ttc - $sumpaid)."'; + print ''.price($objp->total_ttc)."'.price($sumpaid)."'.price($objp->total_ttc - $sumpaid)."'; if ($sumpaid < $objp->total_ttc) { $namef = "amount_".$objp->id; @@ -335,11 +335,11 @@ if ($action == 'create' || empty($action)) { // Print total print '
'.$langs->trans("Total").':".price($total_ttc)."".price($totalrecu)."".price($total_ttc - $totalrecu)." '.$langs->trans("Total").':'.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).' 
'; print ''; print '

'; @@ -250,10 +250,10 @@ print '

'; print '
'; print ''; print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; @@ -265,19 +265,19 @@ foreach ($data as $val) $oldyear--; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; } print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; $oldyear=$year; } @@ -289,7 +289,7 @@ print '
'; // Show graphs -print '
'.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
'.$oldyear.'000'.$oldyear.'000
'.$year.''.$val['nb'].''.price(price2num($val['total'], 'MT'), 1).''.price(price2num($val['avg'], 'MT'), 1).''.$year.''.$val['nb'].''.price(price2num($val['total'], 'MT'), 1).''.price(price2num($val['avg'], 'MT'), 1).'
') + .append('') + .append('') + .append($('
'; +print ' - - + - - + + socid > 0) { $newinter->socid=$object->socid; $newinter->fk_projet=$object->fk_projet; + $newinter->fk_project=$object->fk_projet; $newinter->fk_contrat=$object->fk_contrat; } else $newinter->socid=GETPOST("socid"); @@ -772,8 +773,8 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( /* * List mode */ - $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, "; - $sql.= " f.duree, f.fk_contrat, f.fk_projet, f.frequency, f.nb_gen_done, f.nb_gen_max,"; + $sql = "SELECT f.rowid as fich_rec, s.nom as name, s.rowid as socid, f.rowid as facid, f.titre,"; + $sql.= " f.duree, f.fk_contrat, f.fk_projet as fk_project, f.frequency, f.nb_gen_done, f.nb_gen_max,"; $sql.= " f.date_last_gen, f.date_when, f.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter_rec as f"; @@ -863,7 +864,7 @@ $date_next_execution = (GETPOST('remonth') ? dol_mktime( if (! empty($conf->projet->enabled)) { print ''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fbc53183ea1..5f7789e72f5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2310,6 +2310,7 @@ class CommandeFournisseur extends CommonOrder { $this->oldcopy= clone $this; $this->fk_projet = $id_projet; + $this->fk_project = $id_projet; } if (! $notrigger && empty($error)) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 6b533ae2d21..aa914b54894 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -578,7 +578,7 @@ class FactureFournisseur extends CommonInvoice $sql.= " t.fk_user_author,"; $sql.= " t.fk_user_valid,"; $sql.= " t.fk_facture_source,"; - $sql.= " t.fk_projet,"; + $sql.= " t.fk_projet as fk_project,"; $sql.= " t.fk_cond_reglement,"; $sql.= " t.fk_account,"; $sql.= " t.fk_mode_reglement,"; @@ -641,8 +641,8 @@ class FactureFournisseur extends CommonInvoice $this->author = $obj->fk_user_author; $this->fk_user_valid = $obj->fk_user_valid; $this->fk_facture_source = $obj->fk_facture_source; - $this->fk_project = $obj->fk_projet; - $this->cond_reglement_id = $obj->fk_cond_reglement; + $this->fk_project = $obj->fk_project; + $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; $this->cond_reglement = $obj->cond_reglement_libelle; $this->cond_reglement_doc = $obj->cond_reglement_libelle; @@ -1458,7 +1458,7 @@ class FactureFournisseur extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - public function set_draft($user, $idwarehouse = -1) + public function setDraft($user, $idwarehouse = -1) { // phpcs:enable global $conf,$langs; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index bbdea07270e..9eedea68335 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -227,9 +227,11 @@ class ProductFournisseur extends Product * @param float $multicurrency_tx Rate currency * @param string $multicurrency_code Currency code * @param string $desc_fourn Custom description for product_fourn_price + * @param string $barcode Barcode + * @param int $fk_barcode_type Barcode type * @return int <0 if KO, >=0 if OK */ - public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '') + public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '') { // phpcs:enable global $conf, $langs; @@ -350,7 +352,9 @@ class ProductFournisseur extends Product $sql.= " info_bits = ".$newnpr.","; $sql.= " charges = ".$charges.","; // deprecated $sql.= " delivery_time_days = ".($delivery_time_days != '' ? $delivery_time_days : 'null').","; - $sql.= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'"); + $sql.= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'").","; + $sql.= " barcode = ".(empty($barcode) ? 'NULL' : "'".$this->db->escape($barcode)."'").","; + $sql.= " fk_barcode_type = ".(empty($fk_barcode_type) ? 'NULL' : "'".$this->db->escape($fk_barcode_type)."'"); $sql.= " WHERE rowid = ".$this->product_fourn_price_id; // TODO Add price_base_type and price_ttc @@ -400,7 +404,7 @@ class ProductFournisseur extends Product // Add price for this quantity to supplier $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_fournisseur_price("; $sql.= " multicurrency_price, multicurrency_unitprice, multicurrency_tx, fk_multicurrency, multicurrency_code,"; - $sql .= "datec, fk_product, fk_soc, ref_fourn, desc_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, fk_availability, default_vat_code, info_bits, entity, delivery_time_days, supplier_reputation)"; + $sql .= "datec, fk_product, fk_soc, ref_fourn, desc_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, charges, fk_availability, default_vat_code, info_bits, entity, delivery_time_days, supplier_reputation, barcode, fk_barcode_type)"; $sql .= " values("; $sql.= (isset($multicurrency_buyprice)?"'".$this->db->escape(price2num($multicurrency_buyprice))."'":'null').","; $sql.= (isset($multicurrency_unitBuyPrice)?"'".$this->db->escape(price2num($multicurrency_unitBuyPrice))."'":'null').","; @@ -426,6 +430,8 @@ class ProductFournisseur extends Product $sql .= $conf->entity . ","; $sql .= $delivery_time_days . ","; $sql .= (empty($supplier_reputation) ? 'NULL' : "'" . $this->db->escape($supplier_reputation) . "'"); + $sql .= (empty($barcode) ? 'NULL' : "'" . $this->db->escape($barcode) . "'"); + $sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'"); $sql .= ")"; $idinserted = 0; @@ -488,8 +494,9 @@ class ProductFournisseur extends Product $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product, pfp.charges, pfp.fk_supplier_price_expression, pfp.delivery_time_days,"; - $sql.= " pfp.supplier_reputation, pfp.fk_user, pfp.datec"; - $sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; + $sql.= " pfp.supplier_reputation, pfp.fk_user, pfp.datec,"; + $sql.= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,"; + $sql.=" pfp.barcode, pfp.fk_barcode_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; @@ -529,7 +536,10 @@ class ProductFournisseur extends Product $this->fourn_multicurrency_tx = $obj->multicurrency_tx; $this->fourn_multicurrency_id = $obj->fk_multicurrency; $this->fourn_multicurrency_code = $obj->multicurrency_code; - + if($conf->barcode->enabled) { + $this->fourn_barcode = $obj->barcode; + $this->fourn_fk_barcode_type = $obj->fk_barcode_type; + } if (empty($ignore_expression) && !empty($this->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); @@ -582,7 +592,8 @@ class ProductFournisseur extends Product $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; $sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,"; $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,"; - $sql.= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms"; + $sql.= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,"; + $sql.= " pfp.barcode, pfp.fk_barcode_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp, ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")"; $sql.= " AND pfp.fk_soc = s.rowid"; @@ -623,8 +634,8 @@ class ProductFournisseur extends Product $prodfourn->fourn_tva_npr = $record["info_bits"]; $prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; $prodfourn->supplier_reputation = $record["supplier_reputation"]; - $prodfourn->date_creation = $this->db->jdate($record['datec']); - $prodfourn->date_modification = $this->db->jdate($record['tms']); + $prodfourn->fourn_date_creation = $this->db->jdate($record['datec']); + $prodfourn->fourn_date_modification = $this->db->jdate($record['tms']); $prodfourn->fourn_multicurrency_price = $record["multicurrency_price"]; $prodfourn->fourn_multicurrency_unitprice = $record["multicurrency_unitprice"]; @@ -632,6 +643,11 @@ class ProductFournisseur extends Product $prodfourn->fourn_multicurrency_id = $record["fk_multicurrency"]; $prodfourn->fourn_multicurrency_code = $record["multicurrency_code"]; + if($conf->barcode->enabled){ + $prodfourn->barcode = $record["barcode"]; + $prodfourn->fk_barcode_type = $record["fk_barcode_type"]; + } + if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); $price_result = $priceparser->parseProductSupplier($prodfourn); diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index a5016822c66..45ad69f6c64 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -585,7 +585,7 @@ class PaiementFourn extends Paiement $label = ''.$langs->trans("ShowPayment").'
'; $label.= ''.$langs->trans("Ref").': '.$text; - $label.= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); + if ($this->datepaye ? $this->datepaye : $this->date) $label.= '
'.$langs->trans("Date").': '.dol_print_date($this->datepaye ? $this->datepaye : $this->date, 'dayhour'); $linkstart = ''; $linkend = ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 7c4b09a6f6c..bdf480ccfc4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2769,6 +2769,8 @@ elseif (! empty($object->id)) } } + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2fc36516bc6..c2a5552f15e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1446,7 +1446,7 @@ if (empty($reshook)) } } - $object->set_draft($user, $idwarehouse); + $object->setDraft($user, $idwarehouse); // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) @@ -3235,6 +3235,7 @@ else } } + // End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index fa4500b8c31..22470bd4c81 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -69,7 +69,7 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; $optioncss = GETPOST('optioncss', 'alpha'); -$amounts = array();array(); +$amounts = array(); $amountsresttopay=array(); $addwarning=0; @@ -247,7 +247,23 @@ if (empty($reshook)) { $error=0; - $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + + // Clean parameters amount if payment is for a credit note + if (GETPOST('type', 'int') == FactureFournisseur::TYPE_CREDIT_NOTE) + { + foreach ($amounts as $key => $value) // How payment is dispatch + { + $newvalue = price2num($value, 'MT'); + $amounts[$key] = -$newvalue; + } + + foreach ($multicurrency_amounts as $key => $value) // How payment is dispatch + { + $newvalue = price2num($value, 'MT'); + $multicurrency_amounts[$key] = -$newvalue; + } + } if (! $error) { @@ -432,6 +448,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; + print ''; print ''; dol_fiche_head(null); @@ -620,14 +637,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } - print ''; + print ''; - print ''; - print ''; + print ''; // Amount print ''; print ''; print ''; } @@ -166,7 +166,7 @@ if ($object->id) print ''; print ''; print ''; } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 2985386676f..066a21ebad0 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -322,7 +322,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire { $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, 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"; + //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"; $sql.= " AND x.entity = ".$conf->entity; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) $sql.=' AND x.fk_user_author IN ('.join(',', $childids).')'; diff --git a/htdocs/includes/DebugBar/Bridge/CacheCacheCollector.php b/htdocs/includes/DebugBar/Bridge/CacheCacheCollector.php new file mode 100644 index 00000000000..3d841c6784e --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/CacheCacheCollector.php @@ -0,0 +1,62 @@ + + * $debugbar->addCollector(new CacheCacheCollector(CacheManager::get('default'))); + * // or + * $debugbar->addCollector(new CacheCacheCollector()); + * $debugbar['cache']->addCache(CacheManager::get('default')); + * + */ +class CacheCacheCollector extends MonologCollector +{ + protected $logger; + + public function __construct(Cache $cache = null, Logger $logger = null, $level = Logger::DEBUG, $bubble = true) + { + parent::__construct(null, $level, $bubble); + + if ($logger === null) { + $logger = new Logger('Cache'); + } + $this->logger = $logger; + + if ($cache !== null) { + $this->addCache($cache); + } + } + + public function addCache(Cache $cache) + { + $backend = $cache->getBackend(); + if (!($backend instanceof LoggingBackend)) { + $backend = new LoggingBackend($backend, $this->logger); + } + $cache->setBackend($backend); + $this->addLogger($backend->getLogger()); + } + + public function getName() + { + return 'cache'; + } +} diff --git a/htdocs/includes/DebugBar/Bridge/DoctrineCollector.php b/htdocs/includes/DebugBar/Bridge/DoctrineCollector.php new file mode 100644 index 00000000000..6fa358e29ab --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/DoctrineCollector.php @@ -0,0 +1,98 @@ + + * $debugStack = new Doctrine\DBAL\Logging\DebugStack(); + * $entityManager->getConnection()->getConfiguration()->setSQLLogger($debugStack); + * $debugbar->addCollector(new DoctrineCollector($debugStack)); + * + */ +class DoctrineCollector extends DataCollector implements Renderable, AssetProvider +{ + protected $debugStack; + + public function __construct($debugStackOrEntityManager) + { + if ($debugStackOrEntityManager instanceof EntityManager) { + $debugStackOrEntityManager = $debugStackOrEntityManager->getConnection()->getConfiguration()->getSQLLogger(); + } + if (!($debugStackOrEntityManager instanceof DebugStack)) { + throw new DebugBarException("'DoctrineCollector' requires an 'EntityManager' or 'DebugStack' object"); + } + $this->debugStack = $debugStackOrEntityManager; + } + + public function collect() + { + $queries = array(); + $totalExecTime = 0; + foreach ($this->debugStack->queries as $q) { + $queries[] = array( + 'sql' => $q['sql'], + 'params' => (object) $q['params'], + 'duration' => $q['executionMS'], + 'duration_str' => $this->formatDuration($q['executionMS']) + ); + $totalExecTime += $q['executionMS']; + } + + return array( + 'nb_statements' => count($queries), + 'accumulated_duration' => $totalExecTime, + 'accumulated_duration_str' => $this->formatDuration($totalExecTime), + 'statements' => $queries + ); + } + + public function getName() + { + return 'doctrine'; + } + + public function getWidgets() + { + return array( + "database" => array( + "icon" => "arrow-right", + "widget" => "PhpDebugBar.Widgets.SQLQueriesWidget", + "map" => "doctrine", + "default" => "[]" + ), + "database:badge" => array( + "map" => "doctrine.nb_statements", + "default" => 0 + ) + ); + } + + public function getAssets() + { + return array( + 'css' => 'widgets/sqlqueries/widget.css', + 'js' => 'widgets/sqlqueries/widget.js' + ); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/MonologCollector.php b/htdocs/includes/DebugBar/Bridge/MonologCollector.php new file mode 100644 index 00000000000..609d5c5f837 --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/MonologCollector.php @@ -0,0 +1,103 @@ + + * $debugbar->addCollector(new MonologCollector($logger)); + * + */ +class MonologCollector extends AbstractProcessingHandler implements DataCollectorInterface, Renderable, MessagesAggregateInterface +{ + protected $name; + + protected $records = array(); + + /** + * @param Logger $logger + * @param int $level + * @param boolean $bubble + * @param string $name + */ + public function __construct(Logger $logger = null, $level = Logger::DEBUG, $bubble = true, $name = 'monolog') + { + parent::__construct($level, $bubble); + $this->name = $name; + if ($logger !== null) { + $this->addLogger($logger); + } + } + + /** + * Adds logger which messages you want to log + * + * @param Logger $logger + */ + public function addLogger(Logger $logger) + { + $logger->pushHandler($this); + } + + protected function write(array $record) + { + $this->records[] = array( + 'message' => $record['formatted'], + 'is_string' => true, + 'label' => strtolower($record['level_name']), + 'time' => $record['datetime']->format('U') + ); + } + + public function getMessages() + { + return $this->records; + } + + public function collect() + { + return array( + 'count' => count($this->records), + 'records' => $this->records + ); + } + + public function getName() + { + return $this->name; + } + + public function getWidgets() + { + $name = $this->getName(); + return array( + $name => array( + "icon" => "suitcase", + "widget" => "PhpDebugBar.Widgets.MessagesWidget", + "map" => "$name.records", + "default" => "[]" + ), + "$name:badge" => array( + "map" => "$name.count", + "default" => "null" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/PropelCollector.php b/htdocs/includes/DebugBar/Bridge/PropelCollector.php new file mode 100644 index 00000000000..93ad4ff82fd --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/PropelCollector.php @@ -0,0 +1,253 @@ + + * $debugbar->addCollector(new PropelCollector($debugbar['messages'])); + * PropelCollector::enablePropelProfiling(); + * + */ +class PropelCollector extends DataCollector implements BasicLogger, Renderable, AssetProvider +{ + protected $logger; + + protected $statements = array(); + + protected $accumulatedTime = 0; + + protected $peakMemory = 0; + + /** + * Sets the needed configuration option in propel to enable query logging + * + * @param PropelConfiguration $config Apply profiling on a specific config + */ + public static function enablePropelProfiling(PropelConfiguration $config = null) + { + if ($config === null) { + $config = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT); + } + $config->setParameter('debugpdo.logging.details.method.enabled', true); + $config->setParameter('debugpdo.logging.details.time.enabled', true); + $config->setParameter('debugpdo.logging.details.mem.enabled', true); + $allMethods = array( + 'PropelPDO::__construct', // logs connection opening + 'PropelPDO::__destruct', // logs connection close + 'PropelPDO::exec', // logs a query + 'PropelPDO::query', // logs a query + 'PropelPDO::beginTransaction', // logs a transaction begin + 'PropelPDO::commit', // logs a transaction commit + 'PropelPDO::rollBack', // logs a transaction rollBack (watch out for the capital 'B') + 'DebugPDOStatement::execute', // logs a query from a prepared statement + ); + $config->setParameter('debugpdo.logging.methods', $allMethods, false); + } + + /** + * @param LoggerInterface $logger A logger to forward non-query log lines to + * @param PropelPDO $conn Bound this collector to a connection only + */ + public function __construct(LoggerInterface $logger = null, PropelPDO $conn = null) + { + if ($conn) { + $conn->setLogger($this); + } else { + Propel::setLogger($this); + } + $this->logger = $logger; + $this->logQueriesToLogger = false; + } + + public function setLogQueriesToLogger($enable = true) + { + $this->logQueriesToLogger = $enable; + return $this; + } + + public function isLogQueriesToLogger() + { + return $this->logQueriesToLogger; + } + + public function emergency($m) + { + $this->log($m, Propel::LOG_EMERG); + } + + public function alert($m) + { + $this->log($m, Propel::LOG_ALERT); + } + + public function crit($m) + { + $this->log($m, Propel::LOG_CRIT); + } + + public function err($m) + { + $this->log($m, Propel::LOG_ERR); + } + + public function warning($m) + { + $this->log($m, Propel::LOG_WARNING); + } + + public function notice($m) + { + $this->log($m, Propel::LOG_NOTICE); + } + + public function info($m) + { + $this->log($m, Propel::LOG_INFO); + } + + public function debug($m) + { + $this->log($m, Propel::LOG_DEBUG); + } + + public function log($message, $severity = null) + { + if (strpos($message, 'DebugPDOStatement::execute') !== false) { + list($sql, $duration_str) = $this->parseAndLogSqlQuery($message); + if (!$this->logQueriesToLogger) { + return; + } + $message = "$sql ($duration_str)"; + } + + if ($this->logger !== null) { + $this->logger->log($this->convertLogLevel($severity), $message); + } + } + + /** + * Converts Propel log levels to PSR log levels + * + * @param int $level + * @return string + */ + protected function convertLogLevel($level) + { + $map = array( + Propel::LOG_EMERG => LogLevel::EMERGENCY, + Propel::LOG_ALERT => LogLevel::ALERT, + Propel::LOG_CRIT => LogLevel::CRITICAL, + Propel::LOG_ERR => LogLevel::ERROR, + Propel::LOG_WARNING => LogLevel::WARNING, + Propel::LOG_NOTICE => LogLevel::NOTICE, + Propel::LOG_DEBUG => LogLevel::DEBUG + ); + return $map[$level]; + } + + /** + * Parse a log line to extract query information + * + * @param string $message + */ + protected function parseAndLogSqlQuery($message) + { + $parts = explode('|', $message, 4); + $sql = trim($parts[3]); + + $duration = 0; + if (preg_match('/([0-9]+\.[0-9]+)/', $parts[1], $matches)) { + $duration = (float) $matches[1]; + } + + $memory = 0; + if (preg_match('/([0-9]+\.[0-9]+) ([A-Z]{1,2})/', $parts[2], $matches)) { + $memory = (float) $matches[1]; + if ($matches[2] == 'KB') { + $memory *= 1024; + } elseif ($matches[2] == 'MB') { + $memory *= 1024 * 1024; + } + } + + $this->statements[] = array( + 'sql' => $sql, + 'is_success' => true, + 'duration' => $duration, + 'duration_str' => $this->formatDuration($duration), + 'memory' => $memory, + 'memory_str' => $this->formatBytes($memory) + ); + $this->accumulatedTime += $duration; + $this->peakMemory = max($this->peakMemory, $memory); + return array($sql, $this->formatDuration($duration)); + } + + public function collect() + { + return array( + 'nb_statements' => count($this->statements), + 'nb_failed_statements' => 0, + 'accumulated_duration' => $this->accumulatedTime, + 'accumulated_duration_str' => $this->formatDuration($this->accumulatedTime), + 'peak_memory_usage' => $this->peakMemory, + 'peak_memory_usage_str' => $this->formatBytes($this->peakMemory), + 'statements' => $this->statements + ); + } + + public function getName() + { + return 'propel'; + } + + public function getWidgets() + { + return array( + "propel" => array( + "icon" => "bolt", + "widget" => "PhpDebugBar.Widgets.SQLQueriesWidget", + "map" => "propel", + "default" => "[]" + ), + "propel:badge" => array( + "map" => "propel.nb_statements", + "default" => 0 + ) + ); + } + + public function getAssets() + { + return array( + 'css' => 'widgets/sqlqueries/widget.css', + 'js' => 'widgets/sqlqueries/widget.js' + ); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/SlimCollector.php b/htdocs/includes/DebugBar/Bridge/SlimCollector.php new file mode 100644 index 00000000000..030a3baf624 --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/SlimCollector.php @@ -0,0 +1,66 @@ +slim = $slim; + if ($log = $slim->getLog()) { + $this->originalLogWriter = $log->getWriter(); + $log->setWriter($this); + $log->setEnabled(true); + } + } + + public function write($message, $level) + { + if ($this->originalLogWriter) { + $this->originalLogWriter->write($message, $level); + } + $this->addMessage($message, $this->getLevelName($level)); + } + + protected function getLevelName($level) + { + $map = array( + Log::EMERGENCY => LogLevel::EMERGENCY, + Log::ALERT => LogLevel::ALERT, + Log::CRITICAL => LogLevel::CRITICAL, + Log::ERROR => LogLevel::ERROR, + Log::WARN => LogLevel::WARNING, + Log::NOTICE => LogLevel::NOTICE, + Log::INFO => LogLevel::INFO, + Log::DEBUG => LogLevel::DEBUG + ); + return $map[$level]; + } + + public function getName() + { + return 'slim'; + } +} diff --git a/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftLogCollector.php b/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftLogCollector.php new file mode 100644 index 00000000000..fdef79a0bdc --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftLogCollector.php @@ -0,0 +1,44 @@ +registerPlugin(new Swift_Plugins_LoggerPlugin($this)); + } + + public function add($entry) + { + $this->addMessage($entry); + } + + public function dump() + { + return implode(PHP_EOL, $this->_log); + } + + public function getName() + { + return 'swiftmailer_logs'; + } +} diff --git a/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftMailCollector.php b/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftMailCollector.php new file mode 100644 index 00000000000..01a5e906c88 --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/SwiftMailer/SwiftMailCollector.php @@ -0,0 +1,92 @@ +messagesLogger = new Swift_Plugins_MessageLogger(); + $mailer->registerPlugin($this->messagesLogger); + } + + public function collect() + { + $mails = array(); + foreach ($this->messagesLogger->getMessages() as $msg) { + $mails[] = array( + 'to' => $this->formatTo($msg->getTo()), + 'subject' => $msg->getSubject(), + 'headers' => $msg->getHeaders()->toString() + ); + } + return array( + 'count' => count($mails), + 'mails' => $mails + ); + } + + protected function formatTo($to) + { + if (!$to) { + return ''; + } + + $f = array(); + foreach ($to as $k => $v) { + $f[] = (empty($v) ? '' : "$v ") . "<$k>"; + } + return implode(', ', $f); + } + + public function getName() + { + return 'swiftmailer_mails'; + } + + public function getWidgets() + { + return array( + 'emails' => array( + 'icon' => 'inbox', + 'widget' => 'PhpDebugBar.Widgets.MailsWidget', + 'map' => 'swiftmailer_mails.mails', + 'default' => '[]', + 'title' => 'Mails' + ), + 'emails:badge' => array( + 'map' => 'swiftmailer_mails.count', + 'default' => 'null' + ) + ); + } + + public function getAssets() + { + return array( + 'css' => 'widgets/mails/widget.css', + 'js' => 'widgets/mails/widget.js' + ); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigEnvironment.php b/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigEnvironment.php new file mode 100644 index 00000000000..0d4c957f5b2 --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigEnvironment.php @@ -0,0 +1,417 @@ +twig = $twig; + $this->timeDataCollector = $timeDataCollector; + } + + public function __call($name, $arguments) + { + return call_user_func_array(array($this->twig, $name), $arguments); + } + + public function getRenderedTemplates() + { + return $this->renderedTemplates; + } + + public function addRenderedTemplate(array $info) + { + $this->renderedTemplates[] = $info; + } + + public function getTimeDataCollector() + { + return $this->timeDataCollector; + } + + public function getBaseTemplateClass() + { + return $this->twig->getBaseTemplateClass(); + } + + public function setBaseTemplateClass($class) + { + $this->twig->setBaseTemplateClass($class); + } + + public function enableDebug() + { + $this->twig->enableDebug(); + } + + public function disableDebug() + { + $this->twig->disableDebug(); + } + + public function isDebug() + { + return $this->twig->isDebug(); + } + + public function enableAutoReload() + { + $this->twig->enableAutoReload(); + } + + public function disableAutoReload() + { + $this->twig->disableAutoReload(); + } + + public function isAutoReload() + { + return $this->twig->isAutoReload(); + } + + public function enableStrictVariables() + { + $this->twig->enableStrictVariables(); + } + + public function disableStrictVariables() + { + $this->twig->disableStrictVariables(); + } + + public function isStrictVariables() + { + return $this->twig->isStrictVariables(); + } + + public function getCache() + { + return $this->twig->getCache(); + } + + public function setCache($cache) + { + $this->twig->setCache($cache); + } + + public function getCacheFilename($name) + { + return $this->twig->getCacheFilename($name); + } + + public function getTemplateClass($name, $index = null) + { + return $this->twig->getTemplateClass($name, $index); + } + + public function getTemplateClassPrefix() + { + return $this->twig->getTemplateClassPrefix(); + } + + public function render($name, array $context = array()) + { + return $this->loadTemplate($name)->render($context); + } + + public function display($name, array $context = array()) + { + $this->loadTemplate($name)->display($context); + } + + public function loadTemplate($name, $index = null) + { + $cls = $this->twig->getTemplateClass($name, $index); + + if (isset($this->twig->loadedTemplates[$cls])) { + return $this->twig->loadedTemplates[$cls]; + } + + if (!class_exists($cls, false)) { + if (false === $cache = $this->getCacheFilename($name)) { + eval('?>'.$this->compileSource($this->getLoader()->getSource($name), $name)); + } else { + if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) { + $this->writeCacheFile($cache, $this->compileSource($this->getLoader()->getSource($name), $name)); + } + + require_once $cache; + } + } + + if (!$this->twig->runtimeInitialized) { + $this->initRuntime(); + } + + return $this->twig->loadedTemplates[$cls] = new TraceableTwigTemplate($this, new $cls($this)); + } + + public function isTemplateFresh($name, $time) + { + return $this->twig->isTemplateFresh($name, $time); + } + + public function resolveTemplate($names) + { + return $this->twig->resolveTemplate($names); + } + + public function clearTemplateCache() + { + $this->twig->clearTemplateCache(); + } + + public function clearCacheFiles() + { + $this->twig->clearCacheFiles(); + } + + public function getLexer() + { + return $this->twig->getLexer(); + } + + public function setLexer(Twig_LexerInterface $lexer) + { + $this->twig->setLexer($lexer); + } + + public function tokenize($source, $name = null) + { + return $this->twig->tokenize($source, $name); + } + + public function getParser() + { + return $this->twig->getParser(); + } + + public function setParser(Twig_ParserInterface $parser) + { + $this->twig->setParser($parser); + } + + public function parse(Twig_TokenStream $tokens) + { + return $this->twig->parse($tokens); + } + + public function getCompiler() + { + return $this->twig->getCompiler(); + } + + public function setCompiler(Twig_CompilerInterface $compiler) + { + $this->twig->setCompiler($compiler); + } + + public function compile(Twig_NodeInterface $node) + { + return $this->twig->compile($node); + } + + public function compileSource($source, $name = null) + { + return $this->twig->compileSource($source, $name); + } + + public function setLoader(Twig_LoaderInterface $loader) + { + $this->twig->setLoader($loader); + } + + public function getLoader() + { + return $this->twig->getLoader(); + } + + public function setCharset($charset) + { + $this->twig->setCharset($charset); + } + + public function getCharset() + { + return $this->twig->getCharset(); + } + + public function initRuntime() + { + $this->twig->initRuntime(); + } + + public function hasExtension($name) + { + return $this->twig->hasExtension($name); + } + + public function getExtension($name) + { + return $this->twig->getExtension($name); + } + + public function addExtension(Twig_ExtensionInterface $extension) + { + $this->twig->addExtension($extension); + } + + public function removeExtension($name) + { + $this->twig->removeExtension($name); + } + + public function setExtensions(array $extensions) + { + $this->twig->setExtensions($extensions); + } + + public function getExtensions() + { + return $this->twig->getExtensions(); + } + + public function addTokenParser(Twig_TokenParserInterface $parser) + { + $this->twig->addTokenParser($parser); + } + + public function getTokenParsers() + { + return $this->twig->getTokenParsers(); + } + + public function getTags() + { + return $this->twig->getTags(); + } + + public function addNodeVisitor(Twig_NodeVisitorInterface $visitor) + { + $this->twig->addNodeVisitor($visitor); + } + + public function getNodeVisitors() + { + return $this->twig->getNodeVisitors(); + } + + public function addFilter($name, $filter = null) + { + $this->twig->addFilter($name, $filter); + } + + public function getFilter($name) + { + return $this->twig->getFilter($name); + } + + public function registerUndefinedFilterCallback($callable) + { + $this->twig->registerUndefinedFilterCallback($callable); + } + + public function getFilters() + { + return $this->twig->getFilters(); + } + + public function addTest($name, $test = null) + { + $this->twig->addTest($name, $test); + } + + public function getTests() + { + return $this->twig->getTests(); + } + + public function getTest($name) + { + return $this->twig->getTest($name); + } + + public function addFunction($name, $function = null) + { + $this->twig->addFunction($name, $function); + } + + public function getFunction($name) + { + return $this->twig->getFunction($name); + } + + public function registerUndefinedFunctionCallback($callable) + { + $this->twig->registerUndefinedFunctionCallback($callable); + } + + public function getFunctions() + { + return $this->twig->getFunctions(); + } + + public function addGlobal($name, $value) + { + $this->twig->addGlobal($name, $value); + } + + public function getGlobals() + { + return $this->twig->getGlobals(); + } + + public function mergeGlobals(array $context) + { + return $this->twig->mergeGlobals($context); + } + + public function getUnaryOperators() + { + return $this->twig->getUnaryOperators(); + } + + public function getBinaryOperators() + { + return $this->twig->getBinaryOperators(); + } + + public function computeAlternatives($name, $items) + { + return $this->twig->computeAlternatives($name, $items); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigTemplate.php b/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigTemplate.php new file mode 100644 index 00000000000..dab53d15e1f --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/Twig/TraceableTwigTemplate.php @@ -0,0 +1,131 @@ +env = $env; + $this->template = $template; + } + + public function __call($name, $arguments) + { + return call_user_func_array(array($this->template, $name), $arguments); + } + + public function getTemplateName() + { + return $this->template->getTemplateName(); + } + + public function getEnvironment() + { + return $this->template->getEnvironment(); + } + + public function getParent(array $context) + { + return $this->template->getParent($context); + } + + public function isTraitable() + { + return $this->template->isTraitable(); + } + + public function displayParentBlock($name, array $context, array $blocks = array()) + { + $this->template->displayParentBlock($name, $context, $blocks); + } + + public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true) + { + $this->template->displayBlock($name, $context, $blocks, $useBlocks); + } + + public function renderParentBlock($name, array $context, array $blocks = array()) + { + return $this->template->renderParentBlock($name, $context, $blocks); + } + + public function renderBlock($name, array $context, array $blocks = array(), $useBlocks = true) + { + return $this->template->renderBlock($name, $context, $blocks, $useBlocks); + } + + public function hasBlock($name) + { + return $this->template->hasBlock($name); + } + + public function getBlockNames() + { + return $this->template->getBlockNames(); + } + + public function getBlocks() + { + return $this->template->getBlocks(); + } + + public function display(array $context, array $blocks = array()) + { + $start = microtime(true); + $this->template->display($context, $blocks); + $end = microtime(true); + + if ($timeDataCollector = $this->env->getTimeDataCollector()) { + $name = sprintf("twig.render(%s)", $this->template->getTemplateName()); + $timeDataCollector->addMeasure($name, $start, $end); + } + + $this->env->addRenderedTemplate(array( + 'name' => $this->template->getTemplateName(), + 'render_time' => $end - $start + )); + } + + public function render(array $context) + { + $level = ob_get_level(); + ob_start(); + try { + $this->display($context); + } catch (Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + public static function clearCache() + { + Twig_Template::clearCache(); + } +} diff --git a/htdocs/includes/DebugBar/Bridge/Twig/TwigCollector.php b/htdocs/includes/DebugBar/Bridge/Twig/TwigCollector.php new file mode 100644 index 00000000000..fde5a3f85ba --- /dev/null +++ b/htdocs/includes/DebugBar/Bridge/Twig/TwigCollector.php @@ -0,0 +1,87 @@ + + * $env = new TraceableTwigEnvironment(new Twig_Environment($loader)); + * $debugbar->addCollector(new TwigCollector($env)); + * + */ +class TwigCollector extends DataCollector implements Renderable, AssetProvider +{ + public function __construct(TraceableTwigEnvironment $twig) + { + $this->twig = $twig; + } + + public function collect() + { + $templates = array(); + $accuRenderTime = 0; + + foreach ($this->twig->getRenderedTemplates() as $tpl) { + $accuRenderTime += $tpl['render_time']; + $templates[] = array( + 'name' => $tpl['name'], + 'render_time' => $tpl['render_time'], + 'render_time_str' => $this->formatDuration($tpl['render_time']) + ); + } + + return array( + 'nb_templates' => count($templates), + 'templates' => $templates, + 'accumulated_render_time' => $accuRenderTime, + 'accumulated_render_time_str' => $this->formatDuration($accuRenderTime) + ); + } + + public function getName() + { + return 'twig'; + } + + public function getWidgets() + { + return array( + 'twig' => array( + 'icon' => 'leaf', + 'widget' => 'PhpDebugBar.Widgets.TemplatesWidget', + 'map' => 'twig', + 'default' => '[]' + ), + 'twig:badge' => array( + 'map' => 'twig.nb_templates', + 'default' => 0 + ) + ); + } + + public function getAssets() + { + return array( + 'css' => 'widgets/templates/widget.css', + 'js' => 'widgets/templates/widget.js' + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/AggregatedCollector.php b/htdocs/includes/DebugBar/DataCollector/AggregatedCollector.php new file mode 100644 index 00000000000..6c8e711ef76 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/AggregatedCollector.php @@ -0,0 +1,166 @@ + + * $aggcollector = new AggregateCollector('foobar'); + * $aggcollector->addCollector(new MessagesCollector('msg1')); + * $aggcollector->addCollector(new MessagesCollector('msg2')); + * $aggcollector['msg1']->addMessage('hello world'); + * + */ +class AggregatedCollector implements DataCollectorInterface, ArrayAccess +{ + protected $name; + + protected $mergeProperty; + + protected $sort; + + protected $collectors = array(); + + /** + * @param string $name + * @param string $mergeProperty + * @param boolean $sort + */ + public function __construct($name, $mergeProperty = null, $sort = false) + { + $this->name = $name; + $this->mergeProperty = $mergeProperty; + $this->sort = $sort; + } + + /** + * @param DataCollectorInterface $collector + */ + public function addCollector(DataCollectorInterface $collector) + { + $this->collectors[$collector->getName()] = $collector; + } + + /** + * @return array + */ + public function getCollectors() + { + return $this->collectors; + } + + /** + * Merge data from one of the key/value pair of the collected data + * + * @param string $property + */ + public function setMergeProperty($property) + { + $this->mergeProperty = $property; + } + + /** + * @return string + */ + public function getMergeProperty() + { + return $this->mergeProperty; + } + + /** + * Sorts the collected data + * + * If true, sorts using sort() + * If it is a string, sorts the data using the value from a key/value pair of the array + * + * @param bool|string $sort + */ + public function setSort($sort) + { + $this->sort = $sort; + } + + /** + * @return bool|string + */ + public function getSort() + { + return $this->sort; + } + + public function collect() + { + $aggregate = array(); + foreach ($this->collectors as $collector) { + $data = $collector->collect(); + if ($this->mergeProperty !== null) { + $data = $data[$this->mergeProperty]; + } + $aggregate = array_merge($aggregate, $data); + } + + return $this->sort($aggregate); + } + + /** + * Sorts the collected data + * + * @param array $data + * @return array + */ + protected function sort($data) + { + if (is_string($this->sort)) { + $p = $this->sort; + usort($data, function ($a, $b) use ($p) { + if ($a[$p] == $b[$p]) { + return 0; + } + return $a[$p] < $b[$p] ? -1 : 1; + }); + } elseif ($this->sort === true) { + sort($data); + } + return $data; + } + + public function getName() + { + return $this->name; + } + + // -------------------------------------------- + // ArrayAccess implementation + + public function offsetSet($key, $value) + { + throw new DebugBarException("AggregatedCollector[] is read-only"); + } + + public function offsetGet($key) + { + return $this->collectors[$key]; + } + + public function offsetExists($key) + { + return isset($this->collectors[$key]); + } + + public function offsetUnset($key) + { + throw new DebugBarException("AggregatedCollector[] is read-only"); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/AssetProvider.php b/htdocs/includes/DebugBar/DataCollector/AssetProvider.php new file mode 100644 index 00000000000..6910f737e17 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/AssetProvider.php @@ -0,0 +1,28 @@ +name = $name; + $this->data = $data; + } + + /** + * Sets the data + * + * @param array $data + */ + public function setData(array $data) + { + $this->data = $data; + } + + public function collect() + { + $data = array(); + foreach ($this->data as $k => $v) { + if (!is_string($v)) { + $v = $this->getDataFormatter()->formatVar($v); + } + $data[$k] = $v; + } + return $data; + } + + public function getName() + { + return $this->name; + } + + public function getWidgets() + { + $name = $this->getName(); + return array( + "$name" => array( + "icon" => "gear", + "widget" => "PhpDebugBar.Widgets.VariableListWidget", + "map" => "$name", + "default" => "{}" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/DataCollector.php b/htdocs/includes/DebugBar/DataCollector/DataCollector.php new file mode 100644 index 00000000000..081f66e6872 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/DataCollector.php @@ -0,0 +1,90 @@ +dataFormater = $formater; + return $this; + } + + public function getDataFormatter() + { + if ($this->dataFormater === null) { + $this->dataFormater = self::getDefaultDataFormatter(); + } + return $this->dataFormater; + } + + /** + * @deprecated + */ + public function formatVar($var) + { + return $this->getDataFormatter()->formatVar($var); + } + + /** + * @deprecated + */ + public function formatDuration($seconds) + { + return $this->getDataFormatter()->formatDuration($seconds); + } + + /** + * @deprecated + */ + public function formatBytes($size, $precision = 2) + { + return $this->getDataFormatter()->formatBytes($size, $precision); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/DataCollectorInterface.php b/htdocs/includes/DebugBar/DataCollector/DataCollectorInterface.php new file mode 100644 index 00000000000..b7f234cbff9 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/DataCollectorInterface.php @@ -0,0 +1,31 @@ +exceptions[] = $e; + if ($this->chainExceptions && $previous = $e->getPrevious()) { + $this->addException($previous); + } + } + + /** + * Configure whether or not all chained exceptions should be shown. + * + * @param bool $chainExceptions + */ + public function setChainExceptions($chainExceptions = true) + { + $this->chainExceptions = $chainExceptions; + } + + /** + * Returns the list of exceptions being profiled + * + * @return array[Exception] + */ + public function getExceptions() + { + return $this->exceptions; + } + + public function collect() + { + return array( + 'count' => count($this->exceptions), + 'exceptions' => array_map(array($this, 'formatExceptionData'), $this->exceptions) + ); + } + + /** + * Returns exception data as an array + * + * @param Exception $e + * @return array + */ + public function formatExceptionData(Exception $e) + { + $filePath = $e->getFile(); + if ($filePath && file_exists($filePath)) { + $lines = file($filePath); + $start = $e->getLine() - 4; + $lines = array_slice($lines, $start < 0 ? 0 : $start, 7); + } else { + $lines = array("Cannot open the file ($filePath) in which the exception occurred "); + } + + return array( + 'type' => get_class($e), + 'message' => $e->getMessage(), + 'code' => $e->getCode(), + 'file' => $filePath, + 'line' => $e->getLine(), + 'surrounding_lines' => $lines + ); + } + + public function getName() + { + return 'exceptions'; + } + + public function getWidgets() + { + return array( + 'exceptions' => array( + 'icon' => 'bug', + 'widget' => 'PhpDebugBar.Widgets.ExceptionsWidget', + 'map' => 'exceptions.exceptions', + 'default' => '[]' + ), + 'exceptions:badge' => array( + 'map' => 'exceptions.count', + 'default' => 'null' + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/LocalizationCollector.php b/htdocs/includes/DebugBar/DataCollector/LocalizationCollector.php new file mode 100644 index 00000000000..98b9e6334b2 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/LocalizationCollector.php @@ -0,0 +1,64 @@ + $this->getLocale(), + 'domain' => $this->getDomain(), + ); + } + + public function getName() + { + return 'localization'; + } + + public function getWidgets() + { + return array( + 'domain' => array( + 'icon' => 'bookmark', + 'map' => 'localization.domain', + ), + 'locale' => array( + 'icon' => 'flag', + 'map' => 'localization.locale', + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/MemoryCollector.php b/htdocs/includes/DebugBar/DataCollector/MemoryCollector.php new file mode 100644 index 00000000000..1a27c40bf3a --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/MemoryCollector.php @@ -0,0 +1,63 @@ +peakUsage; + } + + /** + * Updates the peak memory usage value + */ + public function updatePeakUsage() + { + $this->peakUsage = memory_get_peak_usage(true); + } + + public function collect() + { + $this->updatePeakUsage(); + return array( + 'peak_usage' => $this->peakUsage, + 'peak_usage_str' => $this->getDataFormatter()->formatBytes($this->peakUsage) + ); + } + + public function getName() + { + return 'memory'; + } + + public function getWidgets() + { + return array( + "memory" => array( + "icon" => "cogs", + "tooltip" => "Memory Usage", + "map" => "memory.peak_usage_str", + "default" => "'0B'" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/MessagesAggregateInterface.php b/htdocs/includes/DebugBar/DataCollector/MessagesAggregateInterface.php new file mode 100644 index 00000000000..1e2d4d2d3f2 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/MessagesAggregateInterface.php @@ -0,0 +1,21 @@ +name = $name; + } + + /** + * Sets the data formater instance used by this collector + * + * @param DataFormatterInterface $formater + */ + public function setDataFormatter(DataFormatterInterface $formater) + { + $this->dataFormater = $formater; + return $this; + } + + public function getDataFormatter() + { + if ($this->dataFormater === null) { + $this->dataFormater = DataCollector::getDefaultDataFormatter(); + } + return $this->dataFormater; + } + + /** + * Adds a message + * + * A message can be anything from an object to a string + * + * @param mixed $message + * @param string $label + */ + public function addMessage($message, $label = 'info', $isString = true) + { + if (!is_string($message)) { + $message = $this->getDataFormatter()->formatVar($message); + $isString = false; + } + $this->messages[] = array( + 'message' => $message, + 'is_string' => $isString, + 'label' => $label, + 'time' => microtime(true) + ); + } + + /** + * Aggregates messages from other collectors + * + * @param MessagesAggregateInterface $messages + */ + public function aggregate(MessagesAggregateInterface $messages) + { + $this->aggregates[] = $messages; + } + + public function getMessages() + { + $messages = $this->messages; + foreach ($this->aggregates as $collector) { + $msgs = array_map(function ($m) use ($collector) { + $m['collector'] = $collector->getName(); + return $m; + }, $collector->getMessages()); + $messages = array_merge($messages, $msgs); + } + + // sort messages by their timestamp + usort($messages, function ($a, $b) { + if ($a['time'] === $b['time']) { + return 0; + } + return $a['time'] < $b['time'] ? -1 : 1; + }); + + return $messages; + } + + public function log($level, $message, array $context = array()) + { + $this->addMessage($message, $level); + } + + /** + * Deletes all messages + */ + public function clear() + { + $this->messages = array(); + } + + public function collect() + { + $messages = $this->getMessages(); + return array( + 'count' => count($messages), + 'messages' => $messages + ); + } + + public function getName() + { + return $this->name; + } + + public function getWidgets() + { + $name = $this->getName(); + return array( + "$name" => array( + 'icon' => 'list-alt', + "widget" => "PhpDebugBar.Widgets.MessagesWidget", + "map" => "$name.messages", + "default" => "[]" + ), + "$name:badge" => array( + "map" => "$name.count", + "default" => "null" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/PDO/PDOCollector.php b/htdocs/includes/DebugBar/DataCollector/PDO/PDOCollector.php new file mode 100644 index 00000000000..37e7b020b1f --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/PDO/PDOCollector.php @@ -0,0 +1,182 @@ +'; + + /** + * @param TraceablePDO $pdo + * @param TimeDataCollector $timeCollector + */ + public function __construct(TraceablePDO $pdo = null, TimeDataCollector $timeCollector = null) + { + $this->timeCollector = $timeCollector; + if ($pdo !== null) { + $this->addConnection($pdo, 'default'); + } + } + + /** + * Renders the SQL of traced statements with params embeded + * + * @param boolean $enabled + */ + public function setRenderSqlWithParams($enabled = true, $quotationChar = '<>') + { + $this->renderSqlWithParams = $enabled; + $this->sqlQuotationChar = $quotationChar; + } + + public function isSqlRenderedWithParams() + { + return $this->renderSqlWithParams; + } + + public function getSqlQuotationChar() + { + return $this->sqlQuotationChar; + } + + /** + * Adds a new PDO instance to be collector + * + * @param TraceablePDO $pdo + * @param string $name Optional connection name + */ + public function addConnection(TraceablePDO $pdo, $name = null) + { + if ($name === null) { + $name = spl_object_hash($pdo); + } + $this->connections[$name] = $pdo; + } + + /** + * Returns PDO instances to be collected + * + * @return array + */ + public function getConnections() + { + return $this->connections; + } + + public function collect() + { + $data = array( + 'nb_statements' => 0, + 'nb_failed_statements' => 0, + 'accumulated_duration' => 0, + 'memory_usage' => 0, + 'peak_memory_usage' => 0, + 'statements' => array() + ); + + foreach ($this->connections as $name => $pdo) { + $pdodata = $this->collectPDO($pdo, $this->timeCollector); + $data['nb_statements'] += $pdodata['nb_statements']; + $data['nb_failed_statements'] += $pdodata['nb_failed_statements']; + $data['accumulated_duration'] += $pdodata['accumulated_duration']; + $data['memory_usage'] += $pdodata['memory_usage']; + $data['peak_memory_usage'] = max($data['peak_memory_usage'], $pdodata['peak_memory_usage']); + $data['statements'] = array_merge($data['statements'], + array_map(function ($s) use ($name) { $s['connection'] = $name; return $s; }, $pdodata['statements'])); + } + + $data['accumulated_duration_str'] = $this->getDataFormatter()->formatDuration($data['accumulated_duration']); + $data['memory_usage_str'] = $this->getDataFormatter()->formatBytes($data['memory_usage']); + $data['peak_memory_usage_str'] = $this->getDataFormatter()->formatBytes($data['peak_memory_usage']); + + return $data; + } + + /** + * Collects data from a single TraceablePDO instance + * + * @param TraceablePDO $pdo + * @param TimeDataCollector $timeCollector + * @return array + */ + protected function collectPDO(TraceablePDO $pdo, TimeDataCollector $timeCollector = null) + { + $stmts = array(); + foreach ($pdo->getExecutedStatements() as $stmt) { + $stmts[] = array( + 'sql' => $this->renderSqlWithParams ? $stmt->getSqlWithParams($this->sqlQuotationChar) : $stmt->getSql(), + 'row_count' => $stmt->getRowCount(), + 'stmt_id' => $stmt->getPreparedId(), + 'prepared_stmt' => $stmt->getSql(), + 'params' => (object) $stmt->getParameters(), + 'duration' => $stmt->getDuration(), + 'duration_str' => $this->getDataFormatter()->formatDuration($stmt->getDuration()), + 'memory' => $stmt->getMemoryUsage(), + 'memory_str' => $this->getDataFormatter()->formatBytes($stmt->getMemoryUsage()), + 'end_memory' => $stmt->getEndMemory(), + 'end_memory_str' => $this->getDataFormatter()->formatBytes($stmt->getEndMemory()), + 'is_success' => $stmt->isSuccess(), + 'error_code' => $stmt->getErrorCode(), + 'error_message' => $stmt->getErrorMessage() + ); + if ($timeCollector !== null) { + $timeCollector->addMeasure($stmt->getSql(), $stmt->getStartTime(), $stmt->getEndTime()); + } + } + + return array( + 'nb_statements' => count($stmts), + 'nb_failed_statements' => count($pdo->getFailedExecutedStatements()), + 'accumulated_duration' => $pdo->getAccumulatedStatementsDuration(), + 'accumulated_duration_str' => $this->getDataFormatter()->formatDuration($pdo->getAccumulatedStatementsDuration()), + 'memory_usage' => $pdo->getMemoryUsage(), + 'memory_usage_str' => $this->getDataFormatter()->formatBytes($pdo->getPeakMemoryUsage()), + 'peak_memory_usage' => $pdo->getPeakMemoryUsage(), + 'peak_memory_usage_str' => $this->getDataFormatter()->formatBytes($pdo->getPeakMemoryUsage()), + 'statements' => $stmts + ); + } + + public function getName() + { + return 'pdo'; + } + + public function getWidgets() + { + return array( + "database" => array( + "icon" => "inbox", + "widget" => "PhpDebugBar.Widgets.SQLQueriesWidget", + "map" => "pdo", + "default" => "[]" + ), + "database:badge" => array( + "map" => "pdo.nb_statements", + "default" => 0 + ) + ); + } + + public function getAssets() + { + return array( + 'css' => 'widgets/sqlqueries/widget.css', + 'js' => 'widgets/sqlqueries/widget.js' + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDO.php b/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDO.php new file mode 100644 index 00000000000..5f7688b978e --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDO.php @@ -0,0 +1,196 @@ +pdo = $pdo; + $this->pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('DebugBar\DataCollector\PDO\TraceablePDOStatement', array($this))); + } + + public function beginTransaction() + { + return $this->pdo->beginTransaction(); + } + + public function commit() + { + return $this->pdo->commit(); + } + + public function errorCode() + { + return $this->pdo->errorCode(); + } + + public function errorInfo() + { + return $this->pdo->errorInfo(); + } + + public function exec($sql) + { + return $this->profileCall('exec', $sql, func_get_args()); + } + + public function getAttribute($attr) + { + return $this->pdo->getAttribute($attr); + } + + public function inTransaction() + { + return $this->pdo->inTransaction(); + } + + public function lastInsertId($name = null) + { + return $this->pdo->lastInsertId($name); + } + + public function prepare($sql, $driver_options = array()) + { + return $this->pdo->prepare($sql, $driver_options); + } + + public function query($sql) + { + return $this->profileCall('query', $sql, func_get_args()); + } + + public function quote($expr, $parameter_type = PDO::PARAM_STR) + { + return $this->pdo->quote($expr, $parameter_type); + } + + public function rollBack() + { + return $this->pdo->rollBack(); + } + + public function setAttribute($attr, $value) + { + return $this->pdo->setAttribute($attr, $value); + } + + /** + * Profiles a call to a PDO method + * + * @param string $method + * @param string $sql + * @param array $args + * @return mixed The result of the call + */ + protected function profileCall($method, $sql, array $args) + { + $trace = new TracedStatement($sql); + $trace->start(); + + $ex = null; + try { + $result = call_user_func_array(array($this->pdo, $method), $args); + } catch (PDOException $e) { + $ex = $e; + } + + if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION && $result === false) { + $error = $this->pdo->errorInfo(); + $ex = new PDOException($error[2], $error[0]); + } + + $trace->end($ex); + $this->addExecutedStatement($trace); + + if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_EXCEPTION && $ex !== null) { + throw $ex; + } + return $result; + } + + /** + * Adds an executed TracedStatement + * + * @param TracedStatement $stmt + */ + public function addExecutedStatement(TracedStatement $stmt) + { + $this->executedStatements[] = $stmt; + } + + /** + * Returns the accumulated execution time of statements + * + * @return int + */ + public function getAccumulatedStatementsDuration() + { + return array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getDuration(); }); + } + + /** + * Returns the peak memory usage while performing statements + * + * @return int + */ + public function getMemoryUsage() + { + return array_reduce($this->executedStatements, function ($v, $s) { return $v + $s->getMemoryUsage(); }); + } + + /** + * Returns the peak memory usage while performing statements + * + * @return int + */ + public function getPeakMemoryUsage() + { + return array_reduce($this->executedStatements, function ($v, $s) { $m = $s->getEndMemory(); return $m > $v ? $m : $v; }); + } + + /** + * Returns the list of executed statements as TracedStatement objects + * + * @return array + */ + public function getExecutedStatements() + { + return $this->executedStatements; + } + + /** + * Returns the list of failed statements + * + * @return array + */ + public function getFailedExecutedStatements() + { + return array_filter($this->executedStatements, function ($s) { return !$s->isSuccess(); }); + } + + public function __get($name) + { + return $this->pdo->$name; + } + + public function __set($name, $value) + { + $this->pdo->$name = $value; + } + + public function __call($name, $args) + { + return call_user_func_array(array($this->pdo, $name), $args); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDOStatement.php b/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDOStatement.php new file mode 100644 index 00000000000..b903b10c361 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/PDO/TraceablePDOStatement.php @@ -0,0 +1,74 @@ +pdo = $pdo; + } + + public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null) + { + $this->boundParameters[$column] = $param; + $args = array_merge(array($column, &$param), array_slice(func_get_args(), 2)); + return call_user_func_array(array("parent", 'bindColumn'), $args); + } + + public function bindParam($param, &$var, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null) + { + $this->boundParameters[$param] = $var; + $args = array_merge(array($param, &$var), array_slice(func_get_args(), 2)); + return call_user_func_array(array("parent", 'bindParam'), $args); + } + + public function bindValue($param, $value, $data_type = PDO::PARAM_STR) + { + $this->boundParameters[$param] = $value; + return call_user_func_array(array("parent", 'bindValue'), func_get_args()); + } + + public function execute($params = null) + { + $preparedId = spl_object_hash($this); + $boundParameters = $this->boundParameters; + if (is_array($params)) { + $boundParameters = array_merge($boundParameters, $params); + } + + $trace = new TracedStatement($this->queryString, $boundParameters, $preparedId); + $trace->start(); + + $ex = null; + try { + $result = parent::execute($params); + } catch (PDOException $e) { + $ex = $e; + } + + if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) !== PDO::ERRMODE_EXCEPTION && $result === false) { + $error = $this->errorInfo(); + $ex = new PDOException($error[2], $error[0]); + } + + $trace->end($ex, $this->rowCount()); + $this->pdo->addExecutedStatement($trace); + + if ($this->pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_EXCEPTION && $ex !== null) { + throw $ex; + } + return $result; + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/PDO/TracedStatement.php b/htdocs/includes/DebugBar/DataCollector/PDO/TracedStatement.php new file mode 100644 index 00000000000..dc51cee1764 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/PDO/TracedStatement.php @@ -0,0 +1,240 @@ +sql = $sql; + $this->parameters = $this->checkParameters($params); + $this->preparedId = $preparedId; + } + + public function start($startTime = null, $startMemory = null) + { + $this->startTime = $startTime ?: microtime(true); + $this->startMemory = $startMemory ?: memory_get_usage(true); + } + + public function end(\Exception $exception = null, $rowCount = 0, $endTime = null, $endMemory = null) + { + $this->endTime = $endTime ?: microtime(true); + $this->duration = $this->endTime - $this->startTime; + $this->endMemory = $endMemory ?: memory_get_usage(true); + $this->memoryDelta = $this->endMemory - $this->startMemory; + $this->exception = $exception; + $this->rowCount = $rowCount; + } + + /** + * Check parameters for illegal (non UTF-8) strings, like Binary data. + * + * @param $params + * @return mixed + */ + public function checkParameters($params) + { + foreach ($params as &$param) { + if (!mb_check_encoding($param, 'UTF-8')) { + $param = '[BINARY DATA]'; + } + } + return $params; + } + + /** + * Returns the SQL string used for the query + * + * @return string + */ + public function getSql() + { + return $this->sql; + } + + /** + * Returns the SQL string with any parameters used embedded + * + * @param string $quotationChar + * @return string + */ + public function getSqlWithParams($quotationChar = '<>') + { + if (($l = strlen($quotationChar)) > 1) { + $quoteLeft = substr($quotationChar, 0, $l / 2); + $quoteRight = substr($quotationChar, $l / 2); + } else { + $quoteLeft = $quoteRight = $quotationChar; + } + + $sql = $this->sql; + foreach ($this->parameters as $k => $v) { + $v = "$quoteLeft$v$quoteRight"; + if (!is_numeric($k)) { + $sql = str_replace($k, $v, $sql); + } else { + $p = strpos($sql, '?'); + $sql = substr($sql, 0, $p) . $v. substr($sql, $p + 1); + } + } + return $sql; + } + + /** + * Returns the number of rows affected/returned + * + * @return int + */ + public function getRowCount() + { + return $this->rowCount; + } + + /** + * Returns an array of parameters used with the query + * + * @return array + */ + public function getParameters() + { + $params = array(); + foreach ($this->parameters as $param) { + $params[] = htmlentities($param, ENT_QUOTES, 'UTF-8', false); + } + return $params; + } + + /** + * Returns the prepared statement id + * + * @return string + */ + public function getPreparedId() + { + return $this->preparedId; + } + + /** + * Checks if this is a prepared statement + * + * @return boolean + */ + public function isPrepared() + { + return $this->preparedId !== null; + } + + public function getStartTime() + { + return $this->startTime; + } + + public function getEndTime() + { + return $this->endTime; + } + + /** + * Returns the duration in seconds of the execution + * + * @return int + */ + public function getDuration() + { + return $this->duration; + } + + public function getStartMemory() + { + return $this->startMemory; + } + + public function getEndMemory() + { + return $this->endMemory; + } + + /** + * Returns the memory usage during the execution + * + * @return int + */ + public function getMemoryUsage() + { + return $this->memoryDelta; + } + + /** + * Checks if the statement was successful + * + * @return boolean + */ + public function isSuccess() + { + return $this->exception === null; + } + + /** + * Returns the exception triggered + * + * @return \Exception + */ + public function getException() + { + return $this->exception; + } + + /** + * Returns the exception's code + * + * @return string + */ + public function getErrorCode() + { + return $this->exception !== null ? $this->exception->getCode() : 0; + } + + /** + * Returns the exception's message + * + * @return string + */ + public function getErrorMessage() + { + return $this->exception !== null ? $this->exception->getMessage() : ''; + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/PhpInfoCollector.php b/htdocs/includes/DebugBar/DataCollector/PhpInfoCollector.php new file mode 100644 index 00000000000..57e9e45f47f --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/PhpInfoCollector.php @@ -0,0 +1,51 @@ + PHP_VERSION, + 'interface' => PHP_SAPI + ); + } + + /** + * {@inheritDoc} + */ + public function getWidgets() + { + return array( + "php_version" => array( + "icon" => "code", + "tooltip" => "Version", + "map" => "php.version", + "default" => "" + ), + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/Renderable.php b/htdocs/includes/DebugBar/DataCollector/Renderable.php new file mode 100644 index 00000000000..1a6a833f5d1 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/Renderable.php @@ -0,0 +1,25 @@ +getDataFormatter()->formatVar($GLOBALS[$var]); + } + } + + return $data; + } + + public function getName() + { + return 'request'; + } + + public function getWidgets() + { + return array( + "request" => array( + "icon" => "tags", + "widget" => "PhpDebugBar.Widgets.VariableListWidget", + "map" => "request", + "default" => "{}" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataCollector/TimeDataCollector.php b/htdocs/includes/DebugBar/DataCollector/TimeDataCollector.php new file mode 100644 index 00000000000..19e5a63ced1 --- /dev/null +++ b/htdocs/includes/DebugBar/DataCollector/TimeDataCollector.php @@ -0,0 +1,228 @@ +requestStartTime = $requestStartTime; + } + + /** + * Starts a measure + * + * @param string $name Internal name, used to stop the measure + * @param string|null $label Public name + * @param string|null $collector The source of the collector + */ + public function startMeasure($name, $label = null, $collector = null) + { + $start = microtime(true); + $this->startedMeasures[$name] = array( + 'label' => $label ?: $name, + 'start' => $start, + 'collector' => $collector + ); + } + + /** + * Check a measure exists + * + * @param string $name + * @return bool + */ + public function hasStartedMeasure($name) + { + return isset($this->startedMeasures[$name]); + } + + /** + * Stops a measure + * + * @param string $name + * @param array $params + * @throws DebugBarException + */ + public function stopMeasure($name, $params = array()) + { + $end = microtime(true); + if (!$this->hasStartedMeasure($name)) { + throw new DebugBarException("Failed stopping measure '$name' because it hasn't been started"); + } + $this->addMeasure( + $this->startedMeasures[$name]['label'], + $this->startedMeasures[$name]['start'], + $end, + $params, + $this->startedMeasures[$name]['collector'] + ); + unset($this->startedMeasures[$name]); + } + + /** + * Adds a measure + * + * @param string $label + * @param float $start + * @param float $end + * @param array $params + * @param string|null $collector + */ + public function addMeasure($label, $start, $end, $params = array(), $collector = null) + { + $this->measures[] = array( + 'label' => $label, + 'start' => $start, + 'relative_start' => $start - $this->requestStartTime, + 'end' => $end, + 'relative_end' => $end - $this->requestEndTime, + 'duration' => $end - $start, + 'duration_str' => $this->getDataFormatter()->formatDuration($end - $start), + 'params' => $params, + 'collector' => $collector + ); + } + + /** + * Utility function to measure the execution of a Closure + * + * @param string $label + * @param \Closure $closure + * @param string|null $collector + */ + public function measure($label, \Closure $closure, $collector = null) + { + $name = spl_object_hash($closure); + $this->startMeasure($name, $label, $collector); + $result = $closure(); + $params = is_array($result) ? $result : array(); + $this->stopMeasure($name, $params); + } + + /** + * Returns an array of all measures + * + * @return array + */ + public function getMeasures() + { + return $this->measures; + } + + /** + * Returns the request start time + * + * @return float + */ + public function getRequestStartTime() + { + return $this->requestStartTime; + } + + /** + * Returns the request end time + * + * @return float + */ + public function getRequestEndTime() + { + return $this->requestEndTime; + } + + /** + * Returns the duration of a request + * + * @return float + */ + public function getRequestDuration() + { + if ($this->requestEndTime !== null) { + return $this->requestEndTime - $this->requestStartTime; + } + return microtime(true) - $this->requestStartTime; + } + + public function collect() + { + $this->requestEndTime = microtime(true); + foreach (array_keys($this->startedMeasures) as $name) { + $this->stopMeasure($name); + } + + return array( + 'start' => $this->requestStartTime, + 'end' => $this->requestEndTime, + 'duration' => $this->getRequestDuration(), + 'duration_str' => $this->getDataFormatter()->formatDuration($this->getRequestDuration()), + 'measures' => array_values($this->measures) + ); + } + + public function getName() + { + return 'time'; + } + + public function getWidgets() + { + return array( + "time" => array( + "icon" => "clock-o", + "tooltip" => "Request Duration", + "map" => "time.duration_str", + "default" => "'0ms'" + ), + "timeline" => array( + "icon" => "tasks", + "widget" => "PhpDebugBar.Widgets.TimelineWidget", + "map" => "time", + "default" => "{}" + ) + ); + } +} diff --git a/htdocs/includes/DebugBar/DataFormatter/DataFormatter.php b/htdocs/includes/DebugBar/DataFormatter/DataFormatter.php new file mode 100644 index 00000000000..73269459838 --- /dev/null +++ b/htdocs/includes/DebugBar/DataFormatter/DataFormatter.php @@ -0,0 +1,169 @@ +kintLite($data); + } + + public function formatDuration($seconds) + { + if ($seconds < 0.001) { + return round($seconds * 1000000) . 'μs'; + } elseif ($seconds < 1) { + return round($seconds * 1000, 2) . 'ms'; + } + return round($seconds, 2) . 's'; + } + + public function formatBytes($size, $precision = 2) + { + if ($size === 0 || $size === null) { + return "0B"; + } + $base = log($size) / log(1024); + $suffixes = array('B', 'KB', 'MB', 'GB', 'TB'); + return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; + } + + /** + * lightweight version of Kint::dump(). Uses whitespace for formatting instead of html + * sadly not DRY yet + * + * Extracted from Kint.class.php in raveren/kint, https://github.com/raveren/kint + * Copyright (c) 2013 Rokas Šleinius (raveren@gmail.com) + * + * @param mixed $var + * @param int $level + * + * @return string + */ + protected function kintLite(&$var, $level = 0) + { + // initialize function names into variables for prettier string output (html and implode are also DRY) + $html = "htmlspecialchars"; + $implode = "implode"; + $strlen = "strlen"; + $count = "count"; + $getClass = "get_class"; + + if ( $var === null ) { + return 'NULL'; + } elseif ( is_bool( $var ) ) { + return 'bool ' . ( $var ? 'TRUE' : 'FALSE' ); + } elseif ( is_float( $var ) ) { + return 'float ' . $var; + } elseif ( is_int( $var ) ) { + return 'integer ' . $var; + } elseif ( is_resource( $var ) ) { + if ( ( $type = get_resource_type( $var ) ) === 'stream' and $meta = stream_get_meta_data( $var ) ) { + if ( isset( $meta['uri'] ) ) { + $file = $meta['uri']; + + return "resource ({$type}) {$html( $file, 0 )}"; + } else { + return "resource ({$type})"; + } + } else { + return "resource ({$type})"; + } + } elseif ( is_string( $var ) ) { + return "string ({$strlen( $var )}) \"{$html( $var )}\""; + } elseif ( is_array( $var ) ) { + $output = array(); + $space = str_repeat( $s = ' ', $level ); + + static $marker; + + if ( $marker === null ) { + // Make a unique marker + $marker = uniqid( "\x00" ); + } + + if ( empty( $var ) ) { + return "array()"; + } elseif ( isset( $var[$marker] ) ) { + $output[] = "[\n$space$s*RECURSION*\n$space]"; + } elseif ( $level < 7 ) { + $isSeq = array_keys( $var ) === range( 0, count( $var ) - 1 ); + + $output[] = "["; + + $var[$marker] = true; + + foreach ( $var as $key => &$val ) { + if ( $key === $marker ) { + continue; + } + + $key = $space . $s . ( $isSeq ? "" : "'{$html( $key, 0 )}' => " ); + + $dump = $this->kintLite( $val, $level + 1 ); + $output[] = "{$key}{$dump}"; + } + + unset( $var[$marker] ); + $output[] = "$space]"; + } else { + $output[] = "[\n$space$s*depth too great*\n$space]"; + } + return "array({$count( $var )}) {$implode( "\n", $output )}"; + } elseif ( is_object( $var ) ) { + if ( $var instanceof SplFileInfo ) { + return "object SplFileInfo " . $var->getRealPath(); + } + + // Copy the object as an array + $array = (array) $var; + + $output = array(); + $space = str_repeat( $s = ' ', $level ); + + $hash = spl_object_hash( $var ); + + // Objects that are being dumped + static $objects = array(); + + if ( empty( $array ) ) { + return "object {$getClass( $var )} {}"; + } elseif ( isset( $objects[$hash] ) ) { + $output[] = "{\n$space$s*RECURSION*\n$space}"; + } elseif ( $level < 7 ) { + $output[] = "{"; + $objects[$hash] = true; + + foreach ( $array as $key => & $val ) { + if ( $key[0] === "\x00" ) { + $access = $key[1] === "*" ? "protected" : "private"; + + // Remove the access level from the variable name + $key = substr( $key, strrpos( $key, "\x00" ) + 1 ); + } else { + $access = "public"; + } + + $output[] = "$space$s$access $key -> " . $this->kintLite( $val, $level + 1 ); + } + unset( $objects[$hash] ); + $output[] = "$space}"; + } else { + $output[] = "{\n$space$s*depth too great*\n$space}"; + } + + return "object {$getClass( $var )} ({$count( $array )}) {$implode( "\n", $output )}"; + } else { + return gettype( $var ) . htmlspecialchars( var_export( $var, true ), ENT_NOQUOTES ); + } + } +} diff --git a/htdocs/includes/DebugBar/DataFormatter/DataFormatterInterface.php b/htdocs/includes/DebugBar/DataFormatter/DataFormatterInterface.php new file mode 100644 index 00000000000..cb7b426e70b --- /dev/null +++ b/htdocs/includes/DebugBar/DataFormatter/DataFormatterInterface.php @@ -0,0 +1,42 @@ + + * $debugbar = new DebugBar(); + * $debugbar->addCollector(new DataCollector\MessagesCollector()); + * $debugbar['messages']->addMessage("foobar"); + * + */ +class DebugBar implements ArrayAccess +{ + public static $useOpenHandlerWhenSendingDataHeaders = false; + + protected $collectors = array(); + + protected $data; + + protected $jsRenderer; + + protected $requestIdGenerator; + + protected $requestId; + + protected $storage; + + protected $httpDriver; + + protected $stackSessionNamespace = 'PHPDEBUGBAR_STACK_DATA'; + + protected $stackAlwaysUseSessionStorage = false; + + /** + * Adds a data collector + * + * @param DataCollectorInterface $collector + * + * @throws DebugBarException + * @return $this + */ + public function addCollector(DataCollectorInterface $collector) + { + if ($collector->getName() === '__meta') { + throw new DebugBarException("'__meta' is a reserved name and cannot be used as a collector name"); + } + if (isset($this->collectors[$collector->getName()])) { + throw new DebugBarException("'{$collector->getName()}' is already a registered collector"); + } + $this->collectors[$collector->getName()] = $collector; + return $this; + } + + /** + * Checks if a data collector has been added + * + * @param string $name + * @return boolean + */ + public function hasCollector($name) + { + return isset($this->collectors[$name]); + } + + /** + * Returns a data collector + * + * @param string $name + * @return DataCollectorInterface + */ + public function getCollector($name) + { + if (!isset($this->collectors[$name])) { + throw new DebugBarException("'$name' is not a registered collector"); + } + return $this->collectors[$name]; + } + + /** + * Returns an array of all data collectors + * + * @return array[DataCollectorInterface] + */ + public function getCollectors() + { + return $this->collectors; + } + + /** + * Sets the request id generator + * + * @param RequestIdGeneratorInterface $generator + */ + public function setRequestIdGenerator(RequestIdGeneratorInterface $generator) + { + $this->requestIdGenerator = $generator; + return $this; + } + + /** + * @return RequestIdGeneratorInterface + */ + public function getRequestIdGenerator() + { + if ($this->requestIdGenerator === null) { + $this->requestIdGenerator = new RequestIdGenerator(); + } + return $this->requestIdGenerator; + } + + /** + * Returns the id of the current request + * + * @return string + */ + public function getCurrentRequestId() + { + if ($this->requestId === null) { + $this->requestId = $this->getRequestIdGenerator()->generate(); + } + return $this->requestId; + } + + /** + * Sets the storage backend to use to store the collected data + * + * @param StorageInterface $storage + */ + public function setStorage(StorageInterface $storage = null) + { + $this->storage = $storage; + return $this; + } + + /** + * @return StorageInterface + */ + public function getStorage() + { + return $this->storage; + } + + /** + * Checks if the data will be persisted + * + * @return boolean + */ + public function isDataPersisted() + { + return $this->storage !== null; + } + + /** + * Sets the HTTP driver + * + * @param HttpDriverInterface $driver + */ + public function setHttpDriver(HttpDriverInterface $driver) + { + $this->httpDriver = $driver; + return $this; + } + + /** + * Returns the HTTP driver + * + * If no http driver where defined, a PhpHttpDriver is automatically created + * + * @return HttpDriverInterface + */ + public function getHttpDriver() + { + if ($this->httpDriver === null) { + $this->httpDriver = new PhpHttpDriver(); + } + return $this->httpDriver; + } + + /** + * Collects the data from the collectors + * + * @return array + */ + public function collect() + { + $this->data = array( + '__meta' => array( + 'id' => $this->getCurrentRequestId(), + 'datetime' => date('Y-m-d H:i:s'), + 'utime' => microtime(true), + 'method' => isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null, + 'uri' => isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null, + 'ip' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null + ) + ); + + foreach ($this->collectors as $name => $collector) { + $this->data[$name] = $collector->collect(); + } + + // Remove all invalid (non UTF-8) characters + array_walk_recursive($this->data, function (&$item) { + if (is_string($item) && !mb_check_encoding($item, 'UTF-8')) { + $item = mb_convert_encoding($item, 'UTF-8', 'UTF-8'); + } + }); + + if ($this->storage !== null) { + $this->storage->save($this->getCurrentRequestId(), $this->data); + } + + return $this->data; + } + + /** + * Returns collected data + * + * Will collect the data if none have been collected yet + * + * @return array + */ + public function getData() + { + if ($this->data === null) { + $this->collect(); + } + return $this->data; + } + + /** + * Returns an array of HTTP headers containing the data + * + * @param string $headerName + * @param integer $maxHeaderLength + * @return array + */ + public function getDataAsHeaders($headerName = 'phpdebugbar', $maxHeaderLength = 4096, $maxTotalHeaderLength = 250000) + { + $data = rawurlencode(json_encode(array( + 'id' => $this->getCurrentRequestId(), + 'data' => $this->getData() + ))); + + if (strlen($data) > $maxTotalHeaderLength) { + $data = rawurlencode(json_encode(array( + 'error' => 'Maximum header size exceeded' + ))); + } + + $chunks = array(); + + while (strlen($data) > $maxHeaderLength) { + $chunks[] = substr($data, 0, $maxHeaderLength); + $data = substr($data, $maxHeaderLength); + } + $chunks[] = $data; + + $headers = array(); + for ($i = 0, $c = count($chunks); $i < $c; $i++) { + $name = $headerName . ($i > 0 ? "-$i" : ''); + $headers[$name] = $chunks[$i]; + } + + return $headers; + } + + /** + * Sends the data through the HTTP headers + * + * @param bool $useOpenHandler + * @param string $headerName + * @param integer $maxHeaderLength + */ + public function sendDataInHeaders($useOpenHandler = null, $headerName = 'phpdebugbar', $maxHeaderLength = 4096) + { + if ($useOpenHandler === null) { + $useOpenHandler = self::$useOpenHandlerWhenSendingDataHeaders; + } + if ($useOpenHandler && $this->storage !== null) { + $this->getData(); + $headerName .= '-id'; + $headers = array($headerName => $this->getCurrentRequestId()); + } else { + $headers = $this->getDataAsHeaders($headerName, $maxHeaderLength); + } + $this->getHttpDriver()->setHeaders($headers); + return $this; + } + + /** + * Stacks the data in the session for later rendering + */ + public function stackData() + { + $http = $this->initStackSession(); + + $data = null; + if (!$this->isDataPersisted() || $this->stackAlwaysUseSessionStorage) { + $data = $this->getData(); + } elseif ($this->data === null) { + $this->collect(); + } + + $stack = $http->getSessionValue($this->stackSessionNamespace); + $stack[$this->getCurrentRequestId()] = $data; + $http->setSessionValue($this->stackSessionNamespace, $stack); + return $this; + } + + /** + * Checks if there is stacked data in the session + * + * @return boolean + */ + public function hasStackedData() + { + try { + $http = $this->initStackSession(); + } catch (DebugBarException $e) { + return false; + } + return count($http->getSessionValue($this->stackSessionNamespace)) > 0; + } + + /** + * Returns the data stacked in the session + * + * @param boolean $delete Whether to delete the data in the session + * @return array + */ + public function getStackedData($delete = true) + { + $http = $this->initStackSession(); + $stackedData = $http->getSessionValue($this->stackSessionNamespace); + if ($delete) { + $http->deleteSessionValue($this->stackSessionNamespace); + } + + $datasets = array(); + if ($this->isDataPersisted() && !$this->stackAlwaysUseSessionStorage) { + foreach ($stackedData as $id => $data) { + $datasets[$id] = $this->getStorage()->get($id); + } + } else { + $datasets = $stackedData; + } + + return $datasets; + } + + /** + * Sets the key to use in the $_SESSION array + * + * @param string $ns + */ + public function setStackDataSessionNamespace($ns) + { + $this->stackSessionNamespace = $ns; + return $this; + } + + /** + * Returns the key used in the $_SESSION array + * + * @return string + */ + public function getStackDataSessionNamespace() + { + return $this->stackSessionNamespace; + } + + /** + * Sets whether to only use the session to store stacked data even + * if a storage is enabled + * + * @param boolean $enabled + */ + public function setStackAlwaysUseSessionStorage($enabled = true) + { + $this->stackAlwaysUseSessionStorage = $enabled; + return $this; + } + + /** + * Checks if the session is always used to store stacked data + * even if a storage is enabled + * + * @return boolean + */ + public function isStackAlwaysUseSessionStorage() + { + return $this->stackAlwaysUseSessionStorage; + } + + /** + * Initializes the session for stacked data + * + * @return HttpDriverInterface + */ + protected function initStackSession() + { + $http = $this->getHttpDriver(); + if (!$http->isSessionStarted()) { + throw new DebugBarException("Session must be started before using stack data in the debug bar"); + } + + if (!$http->hasSessionValue($this->stackSessionNamespace)) { + $http->setSessionValue($this->stackSessionNamespace, array()); + } + + return $http; + } + + /** + * Returns a JavascriptRenderer for this instance + * + * @param string $baseUrl + * @param string $basePathng + * @return JavascriptRenderer + */ + public function getJavascriptRenderer($baseUrl = null, $basePath = null) + { + if ($this->jsRenderer === null) { + $this->jsRenderer = new JavascriptRenderer($this, $baseUrl, $basePath); + } + return $this->jsRenderer; + } + + // -------------------------------------------- + // ArrayAccess implementation + + public function offsetSet($key, $value) + { + throw new DebugBarException("DebugBar[] is read-only"); + } + + public function offsetGet($key) + { + return $this->getCollector($key); + } + + public function offsetExists($key) + { + return $this->hasCollector($key); + } + + public function offsetUnset($key) + { + throw new DebugBarException("DebugBar[] is read-only"); + } +} diff --git a/htdocs/includes/DebugBar/DebugBarException.php b/htdocs/includes/DebugBar/DebugBarException.php new file mode 100644 index 00000000000..32ffe255cdc --- /dev/null +++ b/htdocs/includes/DebugBar/DebugBarException.php @@ -0,0 +1,16 @@ + 'vendor/font-awesome/css/font-awesome.min.css', + 'highlightjs' => 'vendor/highlightjs/styles/github.css' + ); + + protected $jsVendors = array( + 'jquery' => 'vendor/jquery/dist/jquery.min.js', + 'highlightjs' => 'vendor/highlightjs/highlight.pack.js' + ); + + protected $includeVendors = true; + + protected $cssFiles = array('debugbar.css', 'widgets.css', 'openhandler.css'); + + protected $jsFiles = array('debugbar.js', 'widgets.js', 'openhandler.js'); + + protected $additionalAssets = array(); + + protected $javascriptClass = 'PhpDebugBar.DebugBar'; + + protected $variableName = 'phpdebugbar'; + + protected $enableJqueryNoConflict = true; + + protected $initialization; + + protected $controls = array(); + + protected $ignoredCollectors = array(); + + protected $ajaxHandlerClass = 'PhpDebugBar.AjaxHandler'; + + protected $ajaxHandlerBindToJquery = true; + + protected $ajaxHandlerBindToXHR = false; + + protected $openHandlerClass = 'PhpDebugBar.OpenHandler'; + + protected $openHandlerUrl; + + /** + * @param \DebugBar\DebugBar $debugBar + * @param string $baseUrl + * @param string $basePath + */ + public function __construct(DebugBar $debugBar, $baseUrl = null, $basePath = null) + { + $this->debugBar = $debugBar; + + if ($baseUrl === null) { + $baseUrl = '/vendor/maximebf/debugbar/src/DebugBar/Resources'; + } + $this->baseUrl = $baseUrl; + + if ($basePath === null) { + $basePath = __DIR__ . DIRECTORY_SEPARATOR . 'Resources'; + } + $this->basePath = $basePath; + + // bitwise operations cannot be done in class definition :( + $this->initialization = self::INITIALIZE_CONSTRUCTOR | self::INITIALIZE_CONTROLS; + } + + /** + * Sets options from an array + * + * Options: + * - base_path + * - base_url + * - include_vendors + * - javascript_class + * - variable_name + * - initialization + * - enable_jquery_noconflict + * - controls + * - disable_controls + * - ignore_collectors + * - ajax_handler_classname + * - ajax_handler_bind_to_jquery + * - open_handler_classname + * - open_handler_url + * + * @param array $options [description] + */ + public function setOptions(array $options) + { + if (array_key_exists('base_path', $options)) { + $this->setBasePath($options['base_path']); + } + if (array_key_exists('base_url', $options)) { + $this->setBaseUrl($options['base_url']); + } + if (array_key_exists('include_vendors', $options)) { + $this->setIncludeVendors($options['include_vendors']); + } + if (array_key_exists('javascript_class', $options)) { + $this->setJavascriptClass($options['javascript_class']); + } + if (array_key_exists('variable_name', $options)) { + $this->setVariableName($options['variable_name']); + } + if (array_key_exists('initialization', $options)) { + $this->setInitialization($options['initialization']); + } + if (array_key_exists('enable_jquery_noconflict', $options)) { + $this->setEnableJqueryNoConflict($options['enable_jquery_noconflict']); + } + if (array_key_exists('controls', $options)) { + foreach ($options['controls'] as $name => $control) { + $this->addControl($name, $control); + } + } + if (array_key_exists('disable_controls', $options)) { + foreach ((array) $options['disable_controls'] as $name) { + $this->disableControl($name); + } + } + if (array_key_exists('ignore_collectors', $options)) { + foreach ((array) $options['ignore_collectors'] as $name) { + $this->ignoreCollector($name); + } + } + if (array_key_exists('ajax_handler_classname', $options)) { + $this->setAjaxHandlerClass($options['ajax_handler_classname']); + } + if (array_key_exists('ajax_handler_bind_to_jquery', $options)) { + $this->setBindAjaxHandlerToJquery($options['ajax_handler_bind_to_jquery']); + } + if (array_key_exists('open_handler_classname', $options)) { + $this->setOpenHandlerClass($options['open_handler_classname']); + } + if (array_key_exists('open_handler_url', $options)) { + $this->setOpenHandlerUrl($options['open_handler_url']); + } + } + + /** + * Sets the path which assets are relative to + * + * @param string $path + */ + public function setBasePath($path) + { + $this->basePath = $path; + return $this; + } + + /** + * Returns the path which assets are relative to + * + * @return string + */ + public function getBasePath() + { + return $this->basePath; + } + + /** + * Sets the base URL from which assets will be served + * + * @param string $url + */ + public function setBaseUrl($url) + { + $this->baseUrl = $url; + return $this; + } + + /** + * Returns the base URL from which assets will be served + * + * @return string + */ + public function getBaseUrl() + { + return $this->baseUrl; + } + + /** + * Whether to include vendor assets + * + * You can only include js or css vendors using + * setIncludeVendors('css') or setIncludeVendors('js') + * + * @param boolean $enabled + */ + public function setIncludeVendors($enabled = true) + { + if (is_string($enabled)) { + $enabled = array($enabled); + } + $this->includeVendors = $enabled; + + if (!$enabled || (is_array($enabled) && !in_array('js', $enabled))) { + // no need to call jQuery.noConflict() if we do not include our own version + $this->enableJqueryNoConflict = false; + } + + return $this; + } + + /** + * Checks if vendors assets are included + * + * @return boolean + */ + public function areVendorsIncluded() + { + return $this->includeVendors !== false; + } + + /** + * Disable a specific vendor's assets. + * + * @param string $name "jquery", "fontawesome", "highlightjs" + * + * @return void + */ + public function disableVendor($name) + { + if (array_key_exists($name, $this->cssVendors)) { + unset($this->cssVendors[$name]); + } + if (array_key_exists($name, $this->jsVendors)) { + unset($this->jsVendors[$name]); + } + } + + /** + * Sets the javascript class name + * + * @param string $className + */ + public function setJavascriptClass($className) + { + $this->javascriptClass = $className; + return $this; + } + + /** + * Returns the javascript class name + * + * @return string + */ + public function getJavascriptClass() + { + return $this->javascriptClass; + } + + /** + * Sets the variable name of the class instance + * + * @param string $name + */ + public function setVariableName($name) + { + $this->variableName = $name; + return $this; + } + + /** + * Returns the variable name of the class instance + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Sets what should be initialized + * + * - INITIALIZE_CONSTRUCTOR: only initializes the instance + * - INITIALIZE_CONTROLS: initializes the controls and data mapping + * - INITIALIZE_CONSTRUCTOR | INITIALIZE_CONTROLS: initialize everything (default) + * + * @param integer $init + */ + public function setInitialization($init) + { + $this->initialization = $init; + return $this; + } + + /** + * Returns what should be initialized + * + * @return integer + */ + public function getInitialization() + { + return $this->initialization; + } + + /** + * Sets whether to call jQuery.noConflict() + * + * @param boolean $enabled + */ + public function setEnableJqueryNoConflict($enabled = true) + { + $this->enableJqueryNoConflict = $enabled; + return $this; + } + + /** + * Checks if jQuery.noConflict() will be called + * + * @return boolean + */ + public function isJqueryNoConflictEnabled() + { + return $this->enableJqueryNoConflict; + } + + /** + * Adds a control to initialize + * + * Possible options: + * - icon: icon name + * - tooltip: string + * - widget: widget class name + * - title: tab title + * - map: a property name from the data to map the control to + * - default: a js string, default value of the data map + * + * "icon" or "widget" are at least needed + * + * @param string $name + * @param array $options + */ + public function addControl($name, array $options) + { + if (count(array_intersect(array_keys($options), array('icon', 'widget', 'tab', 'indicator'))) === 0) { + throw new DebugBarException("Not enough options for control '$name'"); + } + $this->controls[$name] = $options; + return $this; + } + + /** + * Disables a control + * + * @param string $name + */ + public function disableControl($name) + { + $this->controls[$name] = null; + return $this; + } + + /** + * Returns the list of controls + * + * This does not include controls provided by collectors + * + * @return array + */ + public function getControls() + { + return $this->controls; + } + + /** + * Ignores widgets provided by a collector + * + * @param string $name + */ + public function ignoreCollector($name) + { + $this->ignoredCollectors[] = $name; + return $this; + } + + /** + * Returns the list of ignored collectors + * + * @return array + */ + public function getIgnoredCollectors() + { + return $this->ignoredCollectors; + } + + /** + * Sets the class name of the ajax handler + * + * Set to false to disable + * + * @param string $className + */ + public function setAjaxHandlerClass($className) + { + $this->ajaxHandlerClass = $className; + return $this; + } + + /** + * Returns the class name of the ajax handler + * + * @return string + */ + public function getAjaxHandlerClass() + { + return $this->ajaxHandlerClass; + } + + /** + * Sets whether to call bindToJquery() on the ajax handler + * + * @param boolean $bind + */ + public function setBindAjaxHandlerToJquery($bind = true) + { + $this->ajaxHandlerBindToJquery = $bind; + return $this; + } + + /** + * Checks whether bindToJquery() will be called on the ajax handler + * + * @return boolean + */ + public function isAjaxHandlerBoundToJquery() + { + return $this->ajaxHandlerBindToJquery; + } + + /** + * Sets whether to call bindToXHR() on the ajax handler + * + * @param boolean $bind + */ + public function setBindAjaxHandlerToXHR($bind = true) + { + $this->ajaxHandlerBindToXHR = $bind; + return $this; + } + + /** + * Checks whether bindToXHR() will be called on the ajax handler + * + * @return boolean + */ + public function isAjaxHandlerBoundToXHR() + { + return $this->ajaxHandlerBindToXHR; + } + + /** + * Sets the class name of the js open handler + * + * @param string $className + */ + public function setOpenHandlerClass($className) + { + $this->openHandlerClass = $className; + return $this; + } + + /** + * Returns the class name of the js open handler + * + * @return string + */ + public function getOpenHandlerClass() + { + return $this->openHandlerClass; + } + + /** + * Sets the url of the open handler + * + * @param string $url + */ + public function setOpenHandlerUrl($url) + { + $this->openHandlerUrl = $url; + return $this; + } + + /** + * Returns the url for the open handler + * + * @return string + */ + public function getOpenHandlerUrl() + { + return $this->openHandlerUrl; + } + + /** + * Add assets to render in the head + * + * @param array $cssFiles An array of filenames + * @param array $jsFiles An array of filenames + * @param string $basePath Base path of those files + * @param string $baseUrl Base url of those files + */ + public function addAssets($cssFiles, $jsFiles, $basePath = null, $baseUrl = null) + { + $this->additionalAssets[] = array( + 'base_path' => $basePath, + 'base_url' => $baseUrl, + 'css' => (array) $cssFiles, + 'js' => (array) $jsFiles + ); + return $this; + } + + /** + * Returns the list of asset files + * + * @param string $type Only return css or js files + * @param string $relativeTo The type of path to which filenames must be relative (path, url or null) + * @return array + */ + public function getAssets($type = null, $relativeTo = self::RELATIVE_PATH) + { + $cssFiles = $this->cssFiles; + $jsFiles = $this->jsFiles; + + if ($this->includeVendors !== false) { + if ($this->includeVendors === true || in_array('css', $this->includeVendors)) { + $cssFiles = array_merge($this->cssVendors, $cssFiles); + } + if ($this->includeVendors === true || in_array('js', $this->includeVendors)) { + $jsFiles = array_merge($this->jsVendors, $jsFiles); + } + } + + if ($relativeTo) { + $root = $this->getRelativeRoot($relativeTo, $this->basePath, $this->baseUrl); + $cssFiles = $this->makeUriRelativeTo($cssFiles, $root); + $jsFiles = $this->makeUriRelativeTo($jsFiles, $root); + } + + $additionalAssets = $this->additionalAssets; + // finds assets provided by collectors + foreach ($this->debugBar->getCollectors() as $collector) { + if (($collector instanceof AssetProvider) && !in_array($collector->getName(), $this->ignoredCollectors)) { + $additionalAssets[] = $collector->getAssets(); + } + } + + foreach ($additionalAssets as $assets) { + $basePath = isset($assets['base_path']) ? $assets['base_path'] : null; + $baseUrl = isset($assets['base_url']) ? $assets['base_url'] : null; + $root = $this->getRelativeRoot($relativeTo, + $this->makeUriRelativeTo($basePath, $this->basePath), + $this->makeUriRelativeTo($baseUrl, $this->baseUrl)); + $cssFiles = array_merge($cssFiles, $this->makeUriRelativeTo((array) $assets['css'], $root)); + $jsFiles = array_merge($jsFiles, $this->makeUriRelativeTo((array) $assets['js'], $root)); + } + + return $this->filterAssetArray(array($cssFiles, $jsFiles), $type); + } + + /** + * Returns the correct base according to the type + * + * @param string $relativeTo + * @param string $basePath + * @param string $baseUrl + * @return string + */ + protected function getRelativeRoot($relativeTo, $basePath, $baseUrl) + { + if ($relativeTo === self::RELATIVE_PATH) { + return $basePath; + } + if ($relativeTo === self::RELATIVE_URL) { + return $baseUrl; + } + return null; + } + + /** + * Makes a URI relative to another + * + * @param string|array $uri + * @param string $root + * @return string + */ + protected function makeUriRelativeTo($uri, $root) + { + if (!$root) { + return $uri; + } + + if (is_array($uri)) { + $uris = array(); + foreach ($uri as $u) { + $uris[] = $this->makeUriRelativeTo($u, $root); + } + return $uris; + } + + if (substr($uri, 0, 1) === '/' || preg_match('/^([a-zA-Z]+:\/\/|[a-zA-Z]:\/|[a-zA-Z]:\\\)/', $uri)) { + return $uri; + } + return rtrim($root, '/') . "/$uri"; + } + + /** + * Filters a tuple of (css, js) assets according to $type + * + * @param array $array + * @param string $type 'css', 'js' or null for both + * @return array + */ + protected function filterAssetArray($array, $type = null) + { + $type = strtolower($type); + if ($type === 'css') { + return $array[0]; + } + if ($type === 'js') { + return $array[1]; + } + return $array; + } + + /** + * Returns a tuple where the both items are Assetic AssetCollection, + * the first one being css files and the second js files + * + * @param string $type Only return css or js collection + * @return array or \Assetic\Asset\AssetCollection + */ + public function getAsseticCollection($type = null) + { + list($cssFiles, $jsFiles) = $this->getAssets(); + return $this->filterAssetArray(array( + $this->createAsseticCollection($cssFiles), + $this->createAsseticCollection($jsFiles) + ), $type); + } + + /** + * Create an Assetic AssetCollection with the given files. + * Filenames will be converted to absolute path using + * the base path. + * + * @param array $files + * @return \Assetic\Asset\AssetCollection + */ + protected function createAsseticCollection($files) + { + $assets = array(); + foreach ($files as $file) { + $assets[] = new \Assetic\Asset\FileAsset($file); + } + return new \Assetic\Asset\AssetCollection($assets); + } + + /** + * Write all CSS assets to standard output or in a file + * + * @param string $targetFilename + */ + public function dumpCssAssets($targetFilename = null) + { + $this->dumpAssets($this->getAssets('css'), $targetFilename); + } + + /** + * Write all JS assets to standard output or in a file + * + * @param string $targetFilename + */ + public function dumpJsAssets($targetFilename = null) + { + $this->dumpAssets($this->getAssets('js'), $targetFilename); + } + + /** + * Write assets to standard output or in a file + * + * @param array $files + * @param string $targetFilename + */ + protected function dumpAssets($files, $targetFilename = null) + { + $content = ''; + foreach ($files as $file) { + $content .= file_get_contents($file) . "\n"; + } + if ($targetFilename !== null) { + file_put_contents($targetFilename, $content); + } else { + echo $content; + } + } + + /** + * Renders the html to include needed assets + * + * Only useful if Assetic is not used + * + * @return string + */ + public function renderHead() + { + list($cssFiles, $jsFiles) = $this->getAssets(null, self::RELATIVE_URL); + $html = ''; + + foreach ($cssFiles as $file) { + $html .= sprintf('' . "\n", $file); + } + + foreach ($jsFiles as $file) { + $html .= sprintf('' . "\n", $file); + } + + if ($this->enableJqueryNoConflict) { + $html .= '' . "\n"; + } + + return $html; + } + + /** + * Register shutdown to display the debug bar + * + * @param boolean $here Set position of HTML. True if is to current position or false for end file + * @param boolean $initialize Whether to render the de bug bar initialization code + * @return string Return "{--DEBUGBAR_OB_START_REPLACE_ME--}" or return an empty string if $here == false + */ + public function renderOnShutdown($here = true, $initialize = true, $renderStackedData = true, $head = false) + { + register_shutdown_function(array($this, "replaceTagInBuffer"), $here, $initialize, $renderStackedData, $head); + + if (ob_get_level() === 0) { + ob_start(); + } + + return ($here) ? self::REPLACEABLE_TAG : ""; + } + + /** + * Same as renderOnShutdown() with $head = true + * + * @param boolean $here + * @param boolean $initialize + * @param boolean $renderStackedData + * @return string + */ + public function renderOnShutdownWithHead($here = true, $initialize = true, $renderStackedData = true) + { + return $this->renderOnShutdown($here, $initialize, $renderStackedData, true); + } + + /** + * Is callback function for register_shutdown_function(...) + * + * @param boolean $here Set position of HTML. True if is to current position or false for end file + * @param boolean $initialize Whether to render the de bug bar initialization code + */ + public function replaceTagInBuffer($here = true, $initialize = true, $renderStackedData = true, $head = false) + { + $render = ($head ? $this->renderHead() : "") + . $this->render($initialize, $renderStackedData); + + $current = ($here && ob_get_level() > 0) ? ob_get_clean() : self::REPLACEABLE_TAG; + + echo str_replace(self::REPLACEABLE_TAG, $render, $current, $count); + + if ($count === 0) { + echo $render; + } + } + + /** + * Returns the code needed to display the debug bar + * + * AJAX request should not render the initialization code. + * + * @param boolean $initialize Whether to render the de bug bar initialization code + * @return string + */ + public function render($initialize = true, $renderStackedData = true) + { + $js = ''; + + if ($initialize) { + $js = $this->getJsInitializationCode(); + } + + if ($renderStackedData && $this->debugBar->hasStackedData()) { + foreach ($this->debugBar->getStackedData() as $id => $data) { + $js .= $this->getAddDatasetCode($id, $data, '(stacked)'); + } + } + + $suffix = !$initialize ? '(ajax)' : null; + $js .= $this->getAddDatasetCode($this->debugBar->getCurrentRequestId(), $this->debugBar->getData(), $suffix); + + return "\n"; + } + + /** + * Returns the js code needed to initialize the debug bar + * + * @return string + */ + protected function getJsInitializationCode() + { + $js = ''; + + if (($this->initialization & self::INITIALIZE_CONSTRUCTOR) === self::INITIALIZE_CONSTRUCTOR) { + $js .= sprintf("var %s = new %s();\n", $this->variableName, $this->javascriptClass); + } + + if (($this->initialization & self::INITIALIZE_CONTROLS) === self::INITIALIZE_CONTROLS) { + $js .= $this->getJsControlsDefinitionCode($this->variableName); + } + + if ($this->ajaxHandlerClass) { + $js .= sprintf("%s.ajaxHandler = new %s(%s);\n", $this->variableName, $this->ajaxHandlerClass, $this->variableName); + if ($this->ajaxHandlerBindToXHR) { + $js .= sprintf("%s.ajaxHandler.bindToXHR();\n", $this->variableName); + } elseif ($this->ajaxHandlerBindToJquery) { + $js .= sprintf("if (jQuery) %s.ajaxHandler.bindToJquery(jQuery);\n", $this->variableName); + } + } + + if ($this->openHandlerUrl !== null) { + $js .= sprintf("%s.setOpenHandler(new %s(%s));\n", $this->variableName, + $this->openHandlerClass, + json_encode(array("url" => $this->openHandlerUrl))); + } + + return $js; + } + + /** + * Returns the js code needed to initialized the controls and data mapping of the debug bar + * + * Controls can be defined by collectors themselves or using {@see addControl()} + * + * @param string $varname Debug bar's variable name + * @return string + */ + protected function getJsControlsDefinitionCode($varname) + { + $js = ''; + $dataMap = array(); + $excludedOptions = array('indicator', 'tab', 'map', 'default', 'widget', 'position'); + + // finds controls provided by collectors + $widgets = array(); + foreach ($this->debugBar->getCollectors() as $collector) { + if (($collector instanceof Renderable) && !in_array($collector->getName(), $this->ignoredCollectors)) { + if ($w = $collector->getWidgets()) { + $widgets = array_merge($widgets, $w); + } + } + } + $controls = array_merge($widgets, $this->controls); + + foreach (array_filter($controls) as $name => $options) { + $opts = array_diff_key($options, array_flip($excludedOptions)); + + if (isset($options['tab']) || isset($options['widget'])) { + if (!isset($opts['title'])) { + $opts['title'] = ucfirst(str_replace('_', ' ', $name)); + } + $js .= sprintf("%s.addTab(\"%s\", new %s({%s%s}));\n", + $varname, + $name, + isset($options['tab']) ? $options['tab'] : 'PhpDebugBar.DebugBar.Tab', + substr(json_encode($opts, JSON_FORCE_OBJECT), 1, -1), + isset($options['widget']) ? sprintf('%s"widget": new %s()', count($opts) ? ', ' : '', $options['widget']) : '' + ); + } elseif (isset($options['indicator']) || isset($options['icon'])) { + $js .= sprintf("%s.addIndicator(\"%s\", new %s(%s), \"%s\");\n", + $varname, + $name, + isset($options['indicator']) ? $options['indicator'] : 'PhpDebugBar.DebugBar.Indicator', + json_encode($opts, JSON_FORCE_OBJECT), + isset($options['position']) ? $options['position'] : 'right' + ); + } + + if (isset($options['map']) && isset($options['default'])) { + $dataMap[$name] = array($options['map'], $options['default']); + } + } + + // creates the data mapping object + $mapJson = array(); + foreach ($dataMap as $name => $values) { + $mapJson[] = sprintf('"%s": ["%s", %s]', $name, $values[0], $values[1]); + } + $js .= sprintf("%s.setDataMap({\n%s\n});\n", $varname, implode(",\n", $mapJson)); + + // activate state restoration + $js .= sprintf("%s.restoreState();\n", $varname); + + return $js; + } + + /** + * Returns the js code needed to add a dataset + * + * @param string $requestId + * @param array $data + * @return string + */ + protected function getAddDatasetCode($requestId, $data, $suffix = null) + { + $js = sprintf("%s.addDataSet(%s, \"%s\"%s);\n", + $this->variableName, + json_encode($data), + $requestId, + $suffix ? ", " . json_encode($suffix) : '' + ); + return $js; + } +} diff --git a/htdocs/includes/DebugBar/OpenHandler.php b/htdocs/includes/DebugBar/OpenHandler.php new file mode 100644 index 00000000000..cbabea268ae --- /dev/null +++ b/htdocs/includes/DebugBar/OpenHandler.php @@ -0,0 +1,107 @@ +isDataPersisted()) { + throw new DebugBarException("DebugBar must have a storage backend to use OpenHandler"); + } + $this->debugBar = $debugBar; + } + + /** + * Handles the current request + * + * @param array $request Request data + */ + public function handle($request = null, $echo = true, $sendHeader = true) + { + if ($request === null) { + $request = $_REQUEST; + } + + $op = 'find'; + if (isset($request['op'])) { + $op = $request['op']; + if (!in_array($op, array('find', 'get', 'clear'))) { + throw new DebugBarException("Invalid operation '{$request['op']}'"); + } + } + + if ($sendHeader) { + $this->debugBar->getHttpDriver()->setHeaders(array( + 'Content-Type' => 'application/json' + )); + } + + $response = json_encode(call_user_func(array($this, $op), $request)); + if ($echo) { + echo $response; + } + return $response; + } + + /** + * Find operation + */ + protected function find($request) + { + $max = 20; + if (isset($request['max'])) { + $max = $request['max']; + } + + $offset = 0; + if (isset($request['offset'])) { + $offset = $request['offset']; + } + + $filters = array(); + foreach (array('utime', 'datetime', 'ip', 'uri', 'method') as $key) { + if (isset($request[$key])) { + $filters[$key] = $request[$key]; + } + } + + return $this->debugBar->getStorage()->find($filters, $max, $offset); + } + + /** + * Get operation + */ + protected function get($request) + { + if (!isset($request['id'])) { + throw new DebugBarException("Missing 'id' parameter in 'get' operation"); + } + return $this->debugBar->getStorage()->get($request['id']); + } + + /** + * Clear operation + */ + protected function clear($request) + { + $this->debugBar->getStorage()->clear(); + return array('success' => true); + } +} diff --git a/htdocs/includes/DebugBar/PhpHttpDriver.php b/htdocs/includes/DebugBar/PhpHttpDriver.php new file mode 100644 index 00000000000..af07060d279 --- /dev/null +++ b/htdocs/includes/DebugBar/PhpHttpDriver.php @@ -0,0 +1,49 @@ + $value) { + header("$name: $value"); + } + } + + function isSessionStarted() + { + return isset($_SESSION); + } + + function setSessionValue($name, $value) + { + $_SESSION[$name] = $value; + } + + function hasSessionValue($name) + { + return array_key_exists($name, $_SESSION); + } + + function getSessionValue($name) + { + return $_SESSION[$name]; + } + + function deleteSessionValue($name) + { + unset($_SESSION[$name]); + } +} diff --git a/htdocs/includes/DebugBar/RequestIdGenerator.php b/htdocs/includes/DebugBar/RequestIdGenerator.php new file mode 100644 index 00000000000..934f407ff8f --- /dev/null +++ b/htdocs/includes/DebugBar/RequestIdGenerator.php @@ -0,0 +1,22 @@ + div > * { + padding: 10px 10px; + font-size: 14px; + color: #555; + text-decoration: none; + outline: none; +} +div.phpdebugbar-header-left > * { + float: left; +} +div.phpdebugbar-header-right > * { + float: right; +} +div.phpdebugbar-header-right > select { + padding: 0; +} + +/* -------------------------------------- */ + +span.phpdebugbar-indicator, +a.phpdebugbar-indicator, +a.phpdebugbar-close-btn { + border-right: 1px solid #ddd; +} + +a.phpdebugbar-tab.phpdebugbar-active { + background: #3d6c99; + color: #fff; +} + +a.phpdebugbar-tab.phpdebugbar-active span.phpdebugbar-badge { + background: #fff; + color: #3d6c99; +} + + a.phpdebugbar-tab span.phpdebugbar-badge { + display: none; + margin-left: 5px; + float: right; + font-size: 11px; + line-height: 14px; + padding: 1px 7px; + background: #3d6c99; + border-radius: 4px; + color: #fff; + font-weight: normal; + text-shadow: none; + vertical-align: middle; + } + a.phpdebugbar-tab i { + display: none; + vertical-align: middle; + } + a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-important { + background: #ed6868; + color: white; + } + +a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-minimize-btn , a.phpdebugbar-maximize-btn { + width: 16px; + height: 16px; +} + +a.phpdebugbar-restore-btn { + width: 26px; + height: 16px; +} + +a.phpdebugbar-minimize-btn , a.phpdebugbar-maximize-btn { + padding-right: 0px !important; +} + +a.phpdebugbar-maximize-btn { display: none} + +a.phpdebugbar-minimize-btn { display: block} + +div.phpdebugbar-minimized a.phpdebugbar-maximize-btn { display: block} + +div.phpdebugbar-minimized a.phpdebugbar-minimize-btn { display: none} + +a.phpdebugbar-minimize-btn { + background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22chevron-down%22%3E%3Cpath%20d%3D%22M1683%20808l-742%20741q-19%2019-45%2019t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19%2045-19t45%2019l531%20531%20531-531q19-19%2045-19t45%2019l166%20165q19%2019%2019%2045.5t-19%2045.5z%22%2F%3E%3C%2Fsvg%3E) no-repeat 10px 10px / 14px 14px; +} + +a.phpdebugbar-maximize-btn { + background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22chevron-up%22%3E%3Cpath%20d%3D%22M1683%201331l-166%20165q-19%2019-45%2019t-45-19l-531-531-531%20531q-19%2019-45%2019t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19%2045-19t45%2019l742%20741q19%2019%2019%2045.5t-19%2045.5z%22%2F%3E%3C%2Fsvg%3E) no-repeat 10px 10px / 14px 14px; +} + +a.phpdebugbar-close-btn { + background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22close%22%3E%3Cpath%20d%3D%22M1490%201322q0%2040-28%2068l-136%20136q-28%2028-68%2028t-68-28l-294-294-294%20294q-28%2028-68%2028t-68-28l-136-136q-28-28-28-68t28-68l294-294-294-294q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20294%20294-294q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068t-28%2068l-294%20294%20294%20294q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) no-repeat 10px 10px / 14px 14px; +} + +a.phpdebugbar-open-btn { + background: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201792%201792%22%20id%3D%22folder-open%22%3E%3Cpath%20d%3D%22M1815%20952q0%2031-31%2066l-336%20396q-43%2051-120.5%2086.5t-143.5%2035.5h-1088q-34%200-60.5-13t-26.5-43q0-31%2031-66l336-396q43-51%20120.5-86.5t143.5-35.5h1088q34%200%2060.5%2013t26.5%2043zm-343-344v160h-832q-94%200-197%2047.5t-164%20119.5l-337%20396-5%206q0-4-.5-12.5t-.5-12.5v-960q0-92%2066-158t158-66h320q92%200%20158%2066t66%20158v32h544q92%200%20158%2066t66%20158z%22%2F%3E%3C%2Fsvg%3E) no-repeat 10px 10px / 14px 14px; +} + +.phpdebugbar-indicator { + position: relative; + cursor: pointer; +} + .phpdebugbar-indicator span.phpdebugbar-text { + margin-left: 5px; + } + .phpdebugbar-indicator span.phpdebugbar-tooltip { + display: none; + position: absolute; + bottom: 45px; + background: #efefef; + border: 1px solid #ccc; + color: #555; + font-size: 11px; + padding: 2px 3px; + z-index: 1000; + text-align: center; + width: 200%; + right: 0; + } + .phpdebugbar-indicator:hover span.phpdebugbar-tooltip:not(.phpdebugbar-disabled) { + display: block; + } + .phpdebugbar-indicator span.phpdebugbar-tooltip-wide { + width: 300%; + } + .phpdebugbar-indicator span.phpdebugbar-tooltip-extra-wide { + width: 400%; + } + .phpdebugbar-indicator span.phpdebugbar-tooltip-html { + display: inline-block; + text-align: left; + } + +select.phpdebugbar-datasets-switcher { + float: right; + display: none; + margin: 8px 0 0 7px; + max-width: 200px; + max-height: 23px; + padding: 0; +} + +/* -------------------------------------- */ + +div.phpdebugbar-body { + border-top: 1px solid #ccc; + display: none; + position: relative; + height: 300px; +} + +/* -------------------------------------- */ + +div.phpdebugbar-panel { + display: none; + height: 100%; + overflow: auto; + width: 100%; +} +div.phpdebugbar-panel.phpdebugbar-active { + display: block; +} + +/* -------------------------------------- */ + +div.phpdebugbar-mini-design a.phpdebugbar-tab { + position: relative; + border-right: 1px solid #ddd; +} + div.phpdebugbar-mini-design a.phpdebugbar-tab span.phpdebugbar-text { + display: none; + } + div.phpdebugbar-mini-design a.phpdebugbar-tab:hover span.phpdebugbar-text { + display: block; + position: absolute; + top: -30px; + background: #efefef; + opacity: .7; + border: 1px solid #ccc; + color: #555; + font-size: 11px; + padding: 2px 3px; + z-index: 1000; + text-align: center; + right: 0; + } + div.phpdebugbar-mini-design a.phpdebugbar-tab i { + display:inline-block; + } diff --git a/htdocs/includes/DebugBar/Resources/debugbar.js b/htdocs/includes/DebugBar/Resources/debugbar.js new file mode 100644 index 00000000000..faf567e37c1 --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/debugbar.js @@ -0,0 +1,1161 @@ +if (typeof(PhpDebugBar) == 'undefined') { + // namespace + var PhpDebugBar = {}; + PhpDebugBar.$ = jQuery; +} + +(function($) { + + if (typeof(localStorage) == 'undefined') { + // provide mock localStorage object for dumb browsers + localStorage = { + setItem: function(key, value) {}, + getItem: function(key) { return null; } + }; + } + + if (typeof(PhpDebugBar.utils) == 'undefined') { + PhpDebugBar.utils = {}; + } + + /** + * Returns the value from an object property. + * Using dots in the key, it is possible to retrieve nested property values + * + * @param {Object} dict + * @param {String} key + * @param {Object} default_value + * @return {Object} + */ + var getDictValue = PhpDebugBar.utils.getDictValue = function(dict, key, default_value) { + var d = dict, parts = key.split('.'); + for (var i = 0; i < parts.length; i++) { + if (!d[parts[i]]) { + return default_value; + } + d = d[parts[i]]; + } + return d; + } + + /** + * Counts the number of properties in an object + * + * @param {Object} obj + * @return {Integer} + */ + var getObjectSize = PhpDebugBar.utils.getObjectSize = function(obj) { + if (Object.keys) { + return Object.keys(obj).length; + } + var count = 0; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + count++; + } + } + return count; + } + + /** + * Returns a prefixed css class name + * + * @param {String} cls + * @return {String} + */ + PhpDebugBar.utils.csscls = function(cls, prefix) { + if (cls.indexOf(' ') > -1) { + var clss = cls.split(' '), out = []; + for (var i = 0, c = clss.length; i < c; i++) { + out.push(PhpDebugBar.utils.csscls(clss[i], prefix)); + } + return out.join(' '); + } + if (cls.indexOf('.') === 0) { + return '.' + prefix + cls.substr(1); + } + return prefix + cls; + }; + + /** + * Creates a partial function of csscls where the second + * argument is already defined + * + * @param {string} prefix + * @return {Function} + */ + PhpDebugBar.utils.makecsscls = function(prefix) { + var f = function(cls) { + return PhpDebugBar.utils.csscls(cls, prefix); + }; + return f; + } + + var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-'); + + + // ------------------------------------------------------------------ + + /** + * Base class for all elements with a visual component + * + * @param {Object} options + * @constructor + */ + var Widget = PhpDebugBar.Widget = function(options) { + this._attributes = $.extend({}, this.defaults); + this._boundAttributes = {}; + this.$el = $('<' + this.tagName + ' />'); + if (this.className) { + this.$el.addClass(this.className); + } + this.initialize.apply(this, [options || {}]); + this.render.apply(this); + }; + + $.extend(Widget.prototype, { + + tagName: 'div', + + className: null, + + defaults: {}, + + /** + * Called after the constructor + * + * @param {Object} options + */ + initialize: function(options) { + this.set(options); + }, + + /** + * Called after the constructor to render the element + */ + render: function() {}, + + /** + * Sets the value of an attribute + * + * @param {String} attr Can also be an object to set multiple attributes at once + * @param {Object} value + */ + set: function(attr, value) { + if (typeof(attr) != 'string') { + for (var k in attr) { + this.set(k, attr[k]); + } + return; + } + + this._attributes[attr] = value; + if (typeof(this._boundAttributes[attr]) !== 'undefined') { + for (var i = 0, c = this._boundAttributes[attr].length; i < c; i++) { + this._boundAttributes[attr][i].apply(this, [value]); + } + } + }, + + /** + * Checks if an attribute exists and is not null + * + * @param {String} attr + * @return {[type]} [description] + */ + has: function(attr) { + return typeof(this._attributes[attr]) !== 'undefined' && this._attributes[attr] !== null; + }, + + /** + * Returns the value of an attribute + * + * @param {String} attr + * @return {Object} + */ + get: function(attr) { + return this._attributes[attr]; + }, + + /** + * Registers a callback function that will be called whenever the value of the attribute changes + * + * If cb is a jQuery element, text() will be used to fill the element + * + * @param {String} attr + * @param {Function} cb + */ + bindAttr: function(attr, cb) { + if ($.isArray(attr)) { + for (var i = 0, c = attr.length; i < c; i++) { + this.bindAttr(attr[i], cb); + } + return; + } + + if (typeof(this._boundAttributes[attr]) == 'undefined') { + this._boundAttributes[attr] = []; + } + if (typeof(cb) == 'object') { + var el = cb; + cb = function(value) { el.text(value || ''); }; + } + this._boundAttributes[attr].push(cb); + if (this.has(attr)) { + cb.apply(this, [this._attributes[attr]]); + } + } + + }); + + + /** + * Creates a subclass + * + * Code from Backbone.js + * + * @param {Array} props Prototype properties + * @return {Function} + */ + Widget.extend = function(props) { + var parent = this; + + var child = function() { return parent.apply(this, arguments); }; + $.extend(child, parent); + + var Surrogate = function(){ this.constructor = child; }; + Surrogate.prototype = parent.prototype; + child.prototype = new Surrogate; + $.extend(child.prototype, props); + + child.__super__ = parent.prototype; + + return child; + }; + + // ------------------------------------------------------------------ + + /** + * Tab + * + * A tab is composed of a tab label which is always visible and + * a tab panel which is visible only when the tab is active. + * + * The panel must contain a widget. A widget is an object which has + * an element property containing something appendable to a jQuery object. + * + * Options: + * - title + * - badge + * - widget + * - data: forward data to widget data + */ + var Tab = Widget.extend({ + + className: csscls('panel'), + + render: function() { + this.$tab = $('').addClass(csscls('tab')); + + this.$icon = $('').appendTo(this.$tab); + this.bindAttr('icon', function(icon) { + if (icon) { + this.$icon.attr('class', 'fa fa-' + icon); + } else { + this.$icon.attr('class', ''); + } + }); + + this.bindAttr('title', $('').addClass(csscls('text')).appendTo(this.$tab)); + + this.$badge = $('').addClass(csscls('badge')).appendTo(this.$tab); + this.bindAttr('badge', function(value) { + if (value !== null) { + this.$badge.text(value); + this.$badge.show(); + } else { + this.$badge.hide(); + } + }); + + this.bindAttr('widget', function(widget) { + this.$el.empty().append(widget.$el); + }); + + this.bindAttr('data', function(data) { + if (this.has('widget')) { + this.get('widget').set('data', data); + } + }) + } + + }); + + // ------------------------------------------------------------------ + + /** + * Indicator + * + * An indicator is a text and an icon to display single value information + * right inside the always visible part of the debug bar + * + * Options: + * - icon + * - title + * - tooltip + * - data: alias of title + */ + var Indicator = Widget.extend({ + + tagName: 'span', + + className: csscls('indicator'), + + render: function() { + this.$icon = $('').appendTo(this.$el); + this.bindAttr('icon', function(icon) { + if (icon) { + this.$icon.attr('class', 'fa fa-' + icon); + } else { + this.$icon.attr('class', ''); + } + }); + + this.bindAttr(['title', 'data'], $('').addClass(csscls('text')).appendTo(this.$el)); + + this.$tooltip = $('').addClass(csscls('tooltip disabled')).appendTo(this.$el); + this.bindAttr('tooltip', function(tooltip) { + if (tooltip) { + this.$tooltip.text(tooltip).removeClass(csscls('disabled')); + } else { + this.$tooltip.addClass(csscls('disabled')); + } + }); + } + + }); + + // ------------------------------------------------------------------ + + /** + * Dataset title formater + * + * Formats the title of a dataset for the select box + */ + var DatasetTitleFormater = PhpDebugBar.DatasetTitleFormater = function(debugbar) { + this.debugbar = debugbar; + }; + + $.extend(DatasetTitleFormater.prototype, { + + /** + * Formats the title of a dataset + * + * @this {DatasetTitleFormater} + * @param {String} id + * @param {Object} data + * @param {String} suffix + * @return {String} + */ + format: function(id, data, suffix) { + if (suffix) { + suffix = ' ' + suffix; + } else { + suffix = ''; + } + + var nb = getObjectSize(this.debugbar.datasets) + 1; + + if (typeof(data['__meta']) === 'undefined') { + return "#" + nb + suffix; + } + + var uri = data['__meta']['uri'], filename; + if (uri.length && uri.charAt(uri.length - 1) === '/') { + // URI ends in a trailing /: get the portion before then to avoid returning an empty string + filename = uri.substr(0, uri.length - 1); // strip trailing '/' + filename = filename.substr(filename.lastIndexOf('/') + 1); // get last path segment + filename += '/'; // add the trailing '/' back + } else { + filename = uri.substr(uri.lastIndexOf('/') + 1); + } + + // truncate the filename in the label, if it's too long + var maxLength = 150; + if (filename.length > maxLength) { + filename = filename.substr(0, maxLength) + '...'; + } + + var label = "#" + nb + " " + filename + suffix + ' (' + data['__meta']['datetime'].split(' ')[1] + ')'; + return label; + } + + }); + + // ------------------------------------------------------------------ + + + /** + * DebugBar + * + * Creates a bar that appends itself to the body of your page + * and sticks to the bottom. + * + * The bar can be customized by adding tabs and indicators. + * A data map is used to fill those controls with data provided + * from datasets. + */ + var DebugBar = PhpDebugBar.DebugBar = Widget.extend({ + + className: "phpdebugbar " + csscls('minimized'), + + options: { + bodyMarginBottom: true, + bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')) + }, + + initialize: function() { + this.controls = {}; + this.dataMap = {}; + this.datasets = {}; + this.firstTabName = null; + this.activePanelName = null; + this.datesetTitleFormater = new DatasetTitleFormater(this); + this.registerResizeHandler(); + }, + + /** + * Register resize event, for resize debugbar with reponsive css. + * + * @this {DebugBar} + */ + registerResizeHandler: function() { + if (typeof this.resize.bind == 'undefined') return; + + var f = this.resize.bind(this); + this.respCSSSize = 0; + $(window).resize(f); + setTimeout(f, 20); + }, + + /** + * Resizes the debugbar to fit the current browser window + */ + resize: function() { + var contentSize = this.respCSSSize; + if (this.respCSSSize == 0) { + this.$header.find("> div > *:visible").each(function () { + contentSize += $(this).outerWidth(); + }); + } + + var currentSize = this.$header.width(); + var cssClass = "phpdebugbar-mini-design"; + var bool = this.$header.hasClass(cssClass); + + if (currentSize <= contentSize && !bool) { + this.respCSSSize = contentSize; + this.$header.addClass(cssClass); + } else if (contentSize < currentSize && bool) { + this.respCSSSize = 0; + this.$header.removeClass(cssClass); + } + + // Reset height to ensure bar is still visible + this.setHeight(this.$body.height()); + }, + + /** + * Initialiazes the UI + * + * @this {DebugBar} + */ + render: function() { + var self = this; + this.$el.appendTo('body'); + this.$dragCapture = $('
').addClass(csscls('drag-capture')).appendTo(this.$el); + this.$resizehdle = $('
').addClass(csscls('resize-handle')).appendTo(this.$el); + this.$header = $('
').addClass(csscls('header')).appendTo(this.$el); + this.$headerLeft = $('
').addClass(csscls('header-left')).appendTo(this.$header); + this.$headerRight = $('
').addClass(csscls('header-right')).appendTo(this.$header); + var $body = this.$body = $('
').addClass(csscls('body')).appendTo(this.$el); + this.recomputeBottomOffset(); + + // dragging of resize handle + var pos_y, orig_h; + this.$resizehdle.on('mousedown', function(e) { + orig_h = $body.height(), pos_y = e.pageY; + $body.parents().on('mousemove', mousemove).on('mouseup', mouseup); + self.$dragCapture.show(); + e.preventDefault(); + }); + var mousemove = function(e) { + var h = orig_h + (pos_y - e.pageY); + self.setHeight(h); + }; + var mouseup = function() { + $body.parents().off('mousemove', mousemove).off('mouseup', mouseup); + self.$dragCapture.hide(); + }; + + // close button + this.$closebtn = $('').addClass(csscls('close-btn')).appendTo(this.$headerRight); + this.$closebtn.click(function() { + self.close(); + }); + + // minimize button + this.$minimizebtn = $('').addClass(csscls('minimize-btn') ).appendTo(this.$headerRight); + this.$minimizebtn.click(function() { + self.minimize(); + }); + + // maximize button + this.$maximizebtn = $('').addClass(csscls('maximize-btn') ).appendTo(this.$headerRight); + this.$maximizebtn.click(function() { + self.restore(); + }); + + // restore button + this.$restorebtn = $('').addClass(csscls('restore-btn')).hide().appendTo(this.$el); + this.$restorebtn.click(function() { + self.restore(); + }); + + // open button + this.$openbtn = $('').addClass(csscls('open-btn')).appendTo(this.$headerRight).hide(); + this.$openbtn.click(function() { + self.openHandler.show(function(id, dataset) { + self.addDataSet(dataset, id, "(opened)"); + self.showTab(); + }); + }); + + // select box for data sets + this.$datasets = $('
'); + $('
PHP DebugBar | Open
').addClass(csscls('header')).append(this.$closebtn).appendTo(this.$el); + $('
'; if ($mesg) { print $mesg; } else { print $px1->show(); diff --git a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php index f206a4b4424..9c7a418a6cc 100644 --- a/htdocs/expensereport/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expensereport/tpl/linkedobjectblock.tpl.php @@ -45,14 +45,14 @@ foreach($linkedObjectBlock as $key => $objectlink) trans("ExpenseReport"); ?> getNomUrl(1); ?> date_debut, 'day'); ?>date_debut, 'day'); ?>rights->expensereport->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>getLibStatut(3); ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
'; if ($objp->fk_project > 0) { - $projectstatic->fetch($objp->fk_projet); + $projectstatic->fetch($objp->fk_project); print $projectstatic->getNomUrl(1); } print ''.price($objp->total_ttc).''.price($sign * $objp->total_ttc).''.price($objp->am); + print ''.price($sign * $objp->am); if ($creditnotes) print '+'.price($creditnotes); if ($deposits) print '+'.price($deposits); print ''.price($remaintopay).''.price($sign * $remaintopay).''; diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php index 26e0884bdd6..ccc92ad2cba 100644 --- a/htdocs/fourn/facture/rapport.php +++ b/htdocs/fourn/facture/rapport.php @@ -26,6 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement_fourn.class.p require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +$langs->loadLangs(array('bills')); + // Security check $socid=''; if (! empty($user->societe_id)) $socid=$user->societe_id; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 9bc181f66d9..1c92e558c41 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -45,7 +45,8 @@ $ref=GETPOST('ref', 'alpha'); $fuserid = (GETPOST('fuserid', 'int')?GETPOST('fuserid', 'int'):$user->id); // Protection if external user -if ($user->societe_id > 0) accessforbidden(); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'holiday', $id, 'holiday'); $now=dol_now(); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 45146324e32..b05e94cccfa 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1023,12 +1023,12 @@ class Holiday extends CommonObject * Warning: It consumes a lot of memory because it load in ->holiday all holiday of a dedicated user at each call. * * @param int $fk_user Id user - * @param date $dateStart Start date of period to check - * @param date $dateEnd End date of period to check + * @param integer $dateStart Start date of period to check + * @param integer $dateEnd End date of period to check * @param int $halfday Tag to define how start and end the period to check: * 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning * @return boolean False = New range overlap an existing holiday, True = no overlapping (is never on holiday during checked period). - * @see verifDateHolidayForTimestamp + * @see verifDateHolidayForTimestamp() */ public function verifDateHolidayCP($fk_user, $dateStart, $dateEnd, $halfday = 0) { @@ -1107,10 +1107,10 @@ class Holiday extends CommonObject * Check that a user is not on holiday for a particular timestamp * * @param int $fk_user Id user - * @param timestamp $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) + * @param integer $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) * @param string $status Filter on holiday status. '-1' = no filter. * @return array array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp. - * @see verifDateHolidayCP + * @see verifDateHolidayCP() */ public function verifDateHolidayForTimestamp($fk_user, $timestamp, $status = '-1') { @@ -1222,7 +1222,7 @@ class Holiday extends CommonObject * * @param int $statut id statut * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto - * @param date $startdate Date holiday should start + * @param integer $startdate Date holiday should start * @return string Label */ public function LibStatut($statut, $mode = 0, $startdate = '') diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index be948280eaf..942b6cb98fb 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -144,7 +144,7 @@ if ($object->id) print ''.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')'.dol_print_date($object->date_debut, 'day'); print '     '; - print $langs->trans($listhalfday[$starthalfday]); + print ''.$langs->trans($listhalfday[$starthalfday]).''; print '
'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')'.dol_print_date($object->date_fin, 'day'); print '     '; - print $langs->trans($listhalfday[$endhalfday]); + print ''.$langs->trans($listhalfday[$endhalfday]).''; print '
DateMethodURLIPFilter data
').append(this.$table).appendTo(this.$el); + this.$actions = $('
').addClass(csscls('actions')).appendTo(this.$el); + + this.$closebtn.on('click', function() { + self.hide(); + }); + + this.$loadmorebtn = $('Load more') + .appendTo(this.$actions) + .on('click', function() { + self.find(self.last_find_request, self.last_find_request.offset + self.get('items_per_page'), self.handleFind.bind(self)); + }); + + this.$showonlycurrentbtn = $('Show only current URL') + .appendTo(this.$actions) + .on('click', function() { + self.$table.empty(); + self.find({uri: window.location.pathname}, 0, self.handleFind.bind(self)); + }); + + this.$showallbtn = $('Show all') + .appendTo(this.$actions) + .on('click', function() { + self.refresh(); + }); + + this.$clearbtn = $('Delete all') + .appendTo(this.$actions) + .on('click', function() { + self.clear(function() { + self.hide(); + }); + }); + + this.addSearch(); + + this.$overlay = $('
').addClass(csscls('overlay')).hide().appendTo('body'); + this.$overlay.on('click', function() { + self.hide(); + }); + }, + + refresh: function() { + this.$table.empty(); + this.$loadmorebtn.show(); + this.find({}, 0, this.handleFind.bind(this)); + }, + + addSearch: function(){ + var self = this; + var searchBtn = $('
' + meta['datetime'] + '' + meta['method'] + '').append(uri)) + .append($('').append(ip)) + .append($('').append(search)) + .appendTo(self.$table); + }); + if (data.length < this.get('items_per_page')) { + this.$loadmorebtn.hide(); + } + }, + + show: function(callback) { + this.callback = callback; + this.$el.show(); + this.$overlay.show(); + this.refresh(); + }, + + hide: function() { + this.$el.hide(); + this.$overlay.hide(); + }, + + find: function(filters, offset, callback) { + var data = $.extend({}, filters, {max: this.get('items_per_page'), offset: offset || 0}); + this.last_find_request = data; + this.ajax(data, callback); + }, + + load: function(id, callback) { + this.ajax({op: "get", id: id}, callback); + }, + + clear: function(callback) { + this.ajax({op: "clear"}, callback); + }, + + ajax: function(data, callback) { + $.ajax({ + dataType: 'json', + url: this.get('url'), + data: data, + success: callback, + ignoreDebugBarAjaxHandler: true + }); + } + + }); + +})(PhpDebugBar.$); diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css new file mode 100644 index 00000000000..ec53d4d6d5b --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.2.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"} \ No newline at end of file diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/FontAwesome.otf b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/FontAwesome.otf new file mode 100644 index 00000000000..81c9ad949b4 Binary files /dev/null and b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/FontAwesome.otf differ diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.eot b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.eot new file mode 100644 index 00000000000..84677bc0c5f Binary files /dev/null and b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.eot differ diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.svg b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.svg new file mode 100644 index 00000000000..d907b25ae60 --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.svg @@ -0,0 +1,520 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.ttf b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.ttf new file mode 100644 index 00000000000..96a3639cdde Binary files /dev/null and b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.ttf differ diff --git a/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.woff b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.woff new file mode 100644 index 00000000000..628b6a52a87 Binary files /dev/null and b/htdocs/includes/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.woff differ diff --git a/htdocs/includes/DebugBar/Resources/vendor/highlightjs/highlight.pack.js b/htdocs/includes/DebugBar/Resources/vendor/highlightjs/highlight.pack.js new file mode 100644 index 00000000000..cf7215a66e1 --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/vendor/highlightjs/highlight.pack.js @@ -0,0 +1 @@ +var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(//gm,">")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset"}function E(G){F+=""}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+=""}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+=""}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"
")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("scilab",function(a){var b=[a.CNM,{cN:"string",b:"'|\"",e:"'|\"",c:[a.BE,{b:"''"}]}];return{k:{keyword:"abort break case clear catch continue do elseif else endfunction end for functionglobal if pause return resume select try then while%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp errorexec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isemptyisinfisnan isvector lasterror length load linspace list listfiles log10 log2 logmax min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand realround sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tantype typename warning zeros matrix"},i:'("|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function endfunction",e:"$",k:"function endfunction|10",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"},],},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",r:0,c:b},{cN:"comment",b:"//",e:"$"}].concat(b)}});hljs.registerLanguage("xml",function(a){var c="[A-Za-z0-9\\._:-]+";var d={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"};var b={eW:true,i:/]+/}]}]}]};return{aliases:["html"],cI:true,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},d,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:"[^ /><]+",r:0},b]}]}});hljs.registerLanguage("asciidoc",function(a){return{c:[{cN:"comment",b:"^/{4,}\\n",e:"\\n/{4,}$",r:10},{cN:"comment",b:"^//",e:"$",r:0},{cN:"title",b:"^\\.\\w.*$"},{b:"^[=\\*]{4,}\\n",e:"\\n^[=\\*]{4,}$",r:10},{cN:"header",b:"^(={1,5}) .+?( \\1)?$",r:10},{cN:"header",b:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$",r:10},{cN:"attribute",b:"^:.+?:",e:"\\s",eE:true,r:10},{cN:"attribute",b:"^\\[.+?\\]$",r:0},{cN:"blockquote",b:"^_{4,}\\n",e:"\\n_{4,}$",r:10},{cN:"code",b:"^[\\-\\.]{4,}\\n",e:"\\n[\\-\\.]{4,}$",r:10},{b:"^\\+{4,}\\n",e:"\\n\\+{4,}$",c:[{b:"<",e:">",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"label",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"smartquote",b:"``.+?''",r:10},{cN:"smartquote",b:"`.+?'",r:10},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{cN:"horizontal_rule",b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:true,c:[{b:"(link|image:?):",r:0},{cN:"link_url",b:"\\w",e:"[^\\[]+",r:0},{cN:"link_label",b:"\\[",e:"\\]",eB:true,eE:true,r:0}],r:10}]}});hljs.registerLanguage("coffeescript",function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module exports global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f=c.inherit(c.TM,{b:a});var e={cN:"subst",b:/#\{/,e:/}/,k:b};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[c.BE]},{b:/'/,e:/'/,c:[c.BE]},{b:/"""/,e:/"""/,c:[c.BE,e]},{b:/"/,e:/"/,c:[c.BE,e]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[e,c.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:true,i:/[:="\[\]]/,c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true,r:0}])}});hljs.registerLanguage("fix",function(a){return{c:[{b:/[^\u2401\u0001]+/,e:/[\u2401\u0001]/,eE:true,rB:true,rE:false,c:[{b:/([^\u2401\u0001=]+)/,e:/=([^\u2401\u0001=]+)/,rE:true,rB:false,cN:"attribute"},{b:/=/,e:/([\u2401\u0001])/,eE:true,eB:true,cN:"string"}]}],cI:true}});hljs.registerLanguage("mel",function(a){return{k:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",i:""}]},{cN:"preprocessor",b:"#",e:"$"},{cN:"class",b:"("+b.split(" ").join("|")+")\\b",e:"({|$)",k:b,l:c,c:[a.UTM]},{cN:"variable",b:"\\."+a.UIR,r:0}]}});hljs.registerLanguage("apache",function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{cI:true,c:[a.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}});hljs.registerLanguage("livecodeserver",function(a){var e={cN:"variable",b:"\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+",r:0};var b={cN:"comment",e:"$",v:[a.CBLCLM,a.HCM,{b:"--",},{b:"[^:]//",}]};var d=a.inherit(a.TM,{v:[{b:"\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*"},{b:"\\b_[a-z0-9\\-]+"}]});var c=a.inherit(a.TM,{b:"\\b([A-Za-z0-9_\\-]+)\\b"});return{cI:false,k:{keyword:"after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if",constant:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",operator:"div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg base64Decode base64Encode baseConvert binaryDecode binaryEncode byteToNum cachedURL cachedURLs charToNum cipherNames commandNames compound compress constantNames cos date dateFormat decompress directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames global globals hasMemory hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec millisecs millisecond milliseconds min monthNames num number numToByte numToChar offset open openfiles openProcesses openProcessIDs openSockets paramCount param params peerAddress pendingMessages platform processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_Execute revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sec secs seconds sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName tick ticks time to toLower toUpper transpose trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus value variableNames version waitDepth weekdayNames wordOffset add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load multiply socket process post seek rel relative read from process rename replace require resetAll revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split subtract union unload wait write"},c:[e,{cN:"keyword",b:"\\bend\\sif\\b"},{cN:"function",bK:"function",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"function",bK:"end",e:"$",c:[c,d]},{cN:"command",bK:"command on",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"command",bK:"end",e:"$",c:[c,d]},{cN:"preprocessor",b:"<\\?rev|<\\?lc|<\\?livecode",r:10},{cN:"preprocessor",b:"<\\?"},{cN:"preprocessor",b:"\\?>"},b,a.ASM,a.QSM,a.BNM,a.CNM,d],i:";$|^\\[|^="}});hljs.registerLanguage("glsl",function(a){return{k:{keyword:"atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",built_in:"gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",literal:"true false"},i:'"',c:[a.CLCM,a.CBLCLM,a.CNM,{cN:"preprocessor",b:"#",e:"$"}]}});hljs.registerLanguage("lasso",function(d){var b="[a-zA-Z_][a-zA-Z0-9_.]*";var i="<\\?(lasso(script)?|=)";var c="\\]|\\?>";var g={literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null bytes list queue set stack staticarray tie local var variable global data self inherited",keyword:"error_code error_msg error_pop error_push error_reset cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"};var a={cN:"comment",b:"",r:0};var j={cN:"preprocessor",b:"\\[noprocess\\]",starts:{cN:"markup",e:"\\[/noprocess\\]",rE:true,c:[a]}};var e={cN:"preprocessor",b:"\\[/noprocess|"+i};var h={cN:"variable",b:"'"+b+"'"};var f=[d.CLCM,{cN:"javadoc",b:"/\\*\\*!",e:"\\*/"},d.CBLCLM,d.inherit(d.CNM,{b:d.CNR+"|-?(infinity|nan)\\b"}),d.inherit(d.ASM,{i:null}),d.inherit(d.QSM,{i:null}),{cN:"string",b:"`",e:"`"},{cN:"variable",v:[{b:"[#$]"+b},{b:"#",e:"\\d+",i:"\\W"}]},{cN:"tag",b:"::\\s*",e:b,i:"\\W"},{cN:"attribute",b:"\\.\\.\\.|-"+d.UIR},{cN:"subst",v:[{b:"->\\s*",c:[h]},{b:":=|/(?!\\w)=?|[-+*%=<>&|!?\\\\]+",r:0}]},{cN:"built_in",b:"\\.\\.?",r:0,c:[h]},{cN:"class",bK:"define",rE:true,e:"\\(|=>",c:[d.inherit(d.TM,{b:d.UIR+"(=(?!>))?"})]}];return{aliases:["ls","lassoscript"],cI:true,l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:"\\[|"+i,rE:true,r:0,c:[a]}},j,e,{cN:"preprocessor",b:"\\[no_square_brackets",starts:{e:"\\[/no_square_brackets\\]",l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:i,rE:true,c:[a]}},j,e].concat(f)}},{cN:"preprocessor",b:"\\[",r:0},{cN:"shebang",b:"^#!.+lasso9\\b",r:10}].concat(f)}});hljs.registerLanguage("mathematica",function(a){return{aliases:["mma"],l:"(\\$|\\b)"+a.IR+"\\b",k:"AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine Transparent UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian XMLElement XMLObject Xnor Xor Yellow YuleDissimilarity ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber",c:[{cN:"comment",b:/\(\*/,e:/\*\)/},a.ASM,a.QSM,a.CNM,{cN:"list",b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("tex",function(a){var d={cN:"command",b:"\\\\[a-zA-Zа-яА-я]+[\\*]?"};var c={cN:"command",b:"\\\\[^a-zA-Zа-яА-я0-9]"};var b={cN:"special",b:"[{}\\[\\]\\&#~]",r:0};return{c:[{b:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",rB:true,c:[d,c,{cN:"number",b:" *=",e:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",eB:true}],r:10},d,c,b,{cN:"formula",b:"\\$\\$",e:"\\$\\$",c:[d,c,b],r:0},{cN:"formula",b:"\\$",e:"\\$",c:[d,c,b],r:0},{cN:"comment",b:"%",e:"$",r:0}]}});hljs.registerLanguage("cs",function(b){var a="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{k:a,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|"},{cN:"xmlDocTag",b:""}]},b.CLCM,b.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},b.ASM,b.QSM,b.CNM,{bK:"protected public private internal",e:/[{;=]/,k:a,c:[{bK:"class namespace interface",starts:{c:[b.TM]}},{b:b.IR+"\\s*\\(",rB:true,c:[b.TM]}]}]}});hljs.registerLanguage("css",function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/,},{b:/(b|br)"/,e:/"/,},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("profile",function(a){return{c:[a.CNM,{cN:"built_in",b:"{",e:"}$",eB:true,eE:true,c:[a.ASM,a.QSM],r:0},{cN:"filename",b:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",e:":",eE:true},{cN:"header",b:"(ncalls|tottime|cumtime)",e:"$",k:"ncalls tottime|10 cumtime|10 filename",r:10},{cN:"summary",b:"function calls",e:"$",c:[a.CNM],r:10},a.ASM,a.QSM,{cN:"function",b:"\\(",e:"\\)$",c:[a.UTM],r:0}]}});hljs.registerLanguage("django",function(a){var b={cN:"filter",b:/\|[A-Za-z]+\:?/,k:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",c:[{cN:"argument",b:/"/,e:/"/},{cN:"argument",b:/'/,e:/'/}]};return{cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"template_comment",b:/\{%\s*comment\s*%}/,e:/\{%\s*endcomment\s*%}/},{cN:"template_comment",b:/\{#/,e:/#}/},{cN:"template_tag",b:/\{%/,e:/%}/,k:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim",c:[b]},{cN:"variable",b:/\{\{/,e:/}}/,c:[b]}]}});hljs.registerLanguage("nginx",function(c){var b={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+c.UIR}]};var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[c.HCM,{cN:"string",c:[c.BE,b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",c:[c.BE,b],v:[{b:"\\s\\^",e:"\\s|{|;",rE:true},{b:"~\\*?\\s+",e:"\\s|{|;",rE:true},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},b]};return{c:[c.HCM,{b:c.UIR+"\\s",e:";|{",rB:true,c:[c.inherit(c.UTM,{starts:a})],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("smalltalk",function(a){var b="[a-z][a-zA-Z0-9_]*";var d={cN:"char",b:"\\$.{1}"};var c={cN:"symbol",b:"#"+a.UIR};return{k:"self super nil true false thisContext",c:[{cN:"comment",b:'"',e:'"'},a.ASM,{cN:"class",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{cN:"method",b:b+":",r:0},a.CNM,c,d,{cN:"localvars",b:"\\|[ ]*"+b+"([ ]+"+b+")*[ ]*\\|",rB:true,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+b}]},{cN:"array",b:"\\#\\(",e:"\\)",c:[a.ASM,d,a.CNM,c]}]}});hljs.registerLanguage("sql",function(a){return{cI:true,i:/[<>]/,c:[{cN:"operator",b:"\\b(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant|merge)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number trigger if before after each row merge matched database",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}});hljs.registerLanguage("oxygene",function(b){var g="abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained";var a={cN:"comment",b:"{",e:"}",r:0};var e={cN:"comment",b:"\\(\\*",e:"\\*\\)",r:10};var c={cN:"string",b:"'",e:"'",c:[{b:"''"}]};var d={cN:"string",b:"(#\\d+)+"};var f={cN:"function",bK:"function constructor destructor procedure method",e:"[:;]",k:"function constructor|10 destructor|10 procedure|10 method|10",c:[b.TM,{cN:"params",b:"\\(",e:"\\)",k:g,c:[c,d]},a,e]};return{cI:true,k:g,i:'("|\\$[G-Zg-z]|\\/\\*|{",e:"}"};var a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@\*](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@\*][^\s\w{]/,r:0}]};var e={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var h=[c.BE,f,a];var b=[a,c.HCM,e,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},g,{cN:"string",c:h,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[c.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[c.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+c.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[c.HCM,e,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[c.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];f.c=b;g.c=b;return{k:d,c:b}});hljs.registerLanguage("ini",function(a){return{cI:true,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}});hljs.registerLanguage("erlang",function(i){var c="[a-z'][a-zA-Z0-9_']*";var o="("+c+":"+c+"|"+c+")";var f={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let not of orelse|10 query receive rem try when xor",literal:"false true"};var l={cN:"comment",b:"%",e:"$",r:0};var e={cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0};var g={b:"fun\\s+"+c+"/\\d+"};var n={b:o+"\\(",e:"\\)",rB:true,r:0,c:[{cN:"function_name",b:o,r:0},{b:"\\(",e:"\\)",eW:true,rE:true,r:0}]};var h={cN:"tuple",b:"{",e:"}",r:0};var a={cN:"variable",b:"\\b_([A-Z][A-Za-z0-9_]*)?",r:0};var m={cN:"variable",b:"[A-Z][a-zA-Z0-9_]*",r:0};var b={b:"#"+i.UIR,r:0,rB:true,c:[{cN:"record_name",b:"#"+i.UIR,r:0},{b:"{",e:"}",r:0}]};var k={bK:"fun receive if try case",e:"end",k:f};k.c=[l,g,i.inherit(i.ASM,{cN:""}),k,n,i.QSM,e,h,a,m,b];var j=[l,g,k,n,i.QSM,e,h,a,m,b];n.c[1].c=j;h.c=j;b.c[1].c=j;var d={cN:"params",b:"\\(",e:"\\)",c:j};return{k:f,i:"(",rB:true,i:"\\(|#|//|/\\*|\\\\|:|;",c:[d,i.inherit(i.TM,{b:c})],starts:{e:";|\\.",k:f,c:j}},l,{cN:"pp",b:"^-",e:"\\.",r:0,eE:true,rB:true,l:"-"+i.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior",c:[d]},e,i.QSM,b,a,m,h]}});hljs.registerLanguage("1c",function(b){var f="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*";var c="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт";var e="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон";var a={cN:"dquote",b:'""'};var d={cN:"string",b:'"',e:'"|$',c:[a]};var g={cN:"string",b:"\\|",e:'"|$',c:[a]};return{cI:true,l:f,k:{keyword:c,built_in:e},c:[b.CLCM,b.NM,d,g,{cN:"function",b:"(процедура|функция)",e:"$",l:f,k:"процедура функция",c:[b.inherit(b.TM,{b:f}),{cN:"tail",eW:true,c:[{cN:"params",b:"\\(",e:"\\)",l:f,k:"знач",c:[d,g]},{cN:"export",b:"экспорт",eW:true,l:f,k:"экспорт",c:[b.CLCM]}]},b.CLCM]},{cN:"preprocessor",b:"#",e:"$"},{cN:"date",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("haskell",function(f){var g={cN:"comment",v:[{b:"--",e:"$"},{b:"{-",e:"-}",c:["self"]}]};var e={cN:"pragma",b:"{-#",e:"#-}"};var b={cN:"preprocessor",b:"^#",e:"$"};var d={cN:"type",b:"\\b[A-Z][\\w']*",r:0};var c={cN:"container",b:"\\(",e:"\\)",i:'"',c:[e,g,b,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},f.inherit(f.TM,{b:"[_a-z][\\w']*"})]};var a={cN:"container",b:"{",e:"}",c:c.c};return{k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{cN:"module",b:"\\bmodule\\b",e:"where",k:"module where",c:[c,g],i:"\\W\\.|;"},{cN:"import",b:"\\bimport\\b",e:"$",k:"import|0 qualified as hiding",c:[c,g],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[d,c,g]},{cN:"typedef",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[e,g,d,c,a]},{cN:"default",bK:"default",e:"$",c:[d,c,g]},{cN:"infix",bK:"infix infixl infixr",e:"$",c:[f.CNM,g]},{cN:"foreign",b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[d,f.QSM,g]},{cN:"shebang",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},e,g,b,f.QSM,f.CNM,d,f.inherit(f.TM,{b:"^[_a-z][\\w']*"}),{b:"->|<-"}]}});hljs.registerLanguage("delphi",function(b){var a="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure";var e={cN:"comment",v:[{b:/\{/,e:/\}/,r:0},{b:/\(\*/,e:/\*\)/,r:10}]};var c={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]};var d={cN:"string",b:/(#\d+)+/};var f={b:b.IR+"\\s*=\\s*class\\s*\\(",rB:true,c:[b.TM]};var g={cN:"function",bK:"function constructor destructor procedure",e:/[:;]/,k:"function constructor|10 destructor|10 procedure|10",c:[b.TM,{cN:"params",b:/\(/,e:/\)/,k:a,c:[c,d]},e]};return{cI:true,k:a,i:/("|\$[G-Zg-z]|\/\*|<\/)/,c:[e,b.CLCM,c,d,b.NM,f,g]}});hljs.registerLanguage("markdown",function(a){return{c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:true,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:true,rE:true,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:true,eE:true},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:true,eE:true,}],r:10},{b:"^\\[.+\\]:",e:"$",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:true,eE:true},{cN:"link_url",b:"\\s",e:"$"}]}]}});hljs.registerLanguage("avrasm",function(a){return{cI:true,k:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf"},c:[a.CBLCLM,{cN:"comment",b:";",e:"$",r:0},a.CNM,a.BNM,{cN:"number",b:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"label",b:"^[A-Za-z0-9_.$]+:"},{cN:"preprocessor",b:"#",e:"$"},{cN:"preprocessor",b:"\\.[a-zA-Z]+"},{cN:"localvars",b:"@[0-9]+"}]}});hljs.registerLanguage("lisp",function(h){var k="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*";var l="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?";var j={cN:"shebang",b:"^#!",e:"$"};var b={cN:"literal",b:"\\b(t{1}|nil)\\b"};var d={cN:"number",v:[{b:l,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"},{b:"#c\\("+l+" +"+l,e:"\\)"}]};var g=h.inherit(h.QSM,{i:null});var m={cN:"comment",b:";",e:"$"};var f={cN:"variable",b:"\\*",e:"\\*"};var n={cN:"keyword",b:"[:&]"+k};var c={b:"\\(",e:"\\)",c:["self",b,g,d]};var a={cN:"quoted",c:[d,g,f,n,c],v:[{b:"['`]\\(",e:"\\)",},{b:"\\(quote ",e:"\\)",k:{title:"quote"},}]};var i={cN:"list",b:"\\(",e:"\\)"};var e={eW:true,r:0};i.c=[{cN:"title",b:k},e];e.c=[a,i,b,d,g,m,f,n];return{i:/\S/,c:[d,j,b,g,m,a,i]}});hljs.registerLanguage("vbnet",function(a){return{cI:true,k:{keyword:"addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass namespace narrowing new next not notinheritable notoverridable of off on operator option optional or order orelse overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim rem removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly xor",built_in:"boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype date decimal directcast double gettype getxmlnamespace iif integer long object sbyte short single string trycast typeof uinteger ulong ushort",literal:"true false nothing"},i:"//|{|}|endif|gosub|variant|wend",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:"'",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"'''|"},{cN:"xmlDocTag",b:""},]},a.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end region externalsource"},]}});hljs.registerLanguage("axapta",function(a){return{k:"false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",c:[a.CLCM,a.CBLCLM,a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"class",bK:"class interface",e:"{",i:":",c:[{cN:"inheritance",bK:"extends implements",r:10},a.UTM]}]}});hljs.registerLanguage("ocaml",function(a){return{k:{keyword:"and as assert asr begin class constraint do done downto else end exception external false for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new object of open or private rec ref sig struct then to true try type val virtual when while with parser value",built_in:"bool char float int list unit array exn option int32 int64 nativeint format4 format6 lazy_t in_channel out_channel string",},i:/\/\//,c:[{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self"]},{cN:"class",bK:"type",e:"\\(|=|$",c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},a.CBLCLM,a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("erlang-repl",function(a){return{k:{special_functions:"spawn spawn_link self",reserved:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},c:[{cN:"prompt",b:"^[0-9]+> ",r:10},{cN:"comment",b:"%",e:"$"},{cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},a.ASM,a.QSM,{cN:"constant",b:"\\?(::)?([A-Z]\\w*(::)?)+"},{cN:"arrow",b:"->"},{cN:"ok",b:"ok"},{cN:"exclamation_mark",b:"!"},{cN:"function_or_atom",b:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",r:0},{cN:"variable",b:"[A-Z][a-zA-Z0-9_']*",r:0}]}});hljs.registerLanguage("vala",function(a){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},c:[{cN:"class",bK:"class interface delegate namespace",e:"{",i:"[^,:\\n\\s\\.]",c:[a.UTM]},a.CLCM,a.CBLCLM,{cN:"string",b:'"""',e:'"""',r:5},a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"^#",e:"$",r:2},{cN:"constant",b:" [A-Z_]+ ",r:0}]}});hljs.registerLanguage("dos",function(a){return{cI:true,k:{flow:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",keyword:"shift cd dir echo setlocal endlocal set pause copy",stream:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",winutils:"ping net ipconfig taskkill xcopy ren del"},c:[{cN:"envvar",b:"%%[^ ]"},{cN:"envvar",b:"%[^ ]+?%"},{cN:"envvar",b:"![^ ]+?!"},{cN:"number",b:"\\b\\d+",r:0},{cN:"comment",b:"@?rem",e:"$"}]}});hljs.registerLanguage("clojure",function(l){var e={built_in:"def cond apply if-not if-let if not not= = < < > <= <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"};var f="[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$';]+";var a="[\\s:\\(\\{]+\\d+(\\.\\d+)?";var d={cN:"number",b:a,r:0};var j=l.inherit(l.QSM,{i:null});var o={cN:"comment",b:";",e:"$",r:0};var n={cN:"collection",b:"[\\[\\{]",e:"[\\]\\}]"};var c={cN:"comment",b:"\\^"+f};var b={cN:"comment",b:"\\^\\{",e:"\\}"};var h={cN:"attribute",b:"[:]"+f};var m={cN:"list",b:"\\(",e:"\\)"};var g={eW:true,k:{literal:"true false nil"},r:0};var i={k:e,l:f,cN:"title",b:f,starts:g};m.c=[{cN:"comment",b:"comment"},i,g];g.c=[m,j,c,b,o,h,n,d];n.c=[m,j,c,o,h,n,d];return{i:/\S/,c:[o,m,{cN:"prompt",b:/^=> /,starts:{e:/\n\n|\Z/}}]}});hljs.registerLanguage("go",function(a){var b={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:b,i:"]/,c:[{bK:"extends implements",r:10},b.UTM]},{b:b.UIR+"\\s*\\(",rB:true,c:[b.UTM]}]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("lua",function(b){var a="\\[=*\\[";var e="\\]=*\\]";var c={b:a,e:e,c:["self"]};var d=[{cN:"comment",b:"--(?!"+a+")",e:"$"},{cN:"comment",b:"--"+a,e:e,c:[c],r:10}];return{l:b.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:d.concat([{cN:"function",bK:"function",e:"\\)",c:[b.inherit(b.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:true,c:d}].concat(d)},b.CNM,b.ASM,b.QSM,{cN:"string",b:a,e:e,c:[c],r:10}])}});hljs.registerLanguage("rsl",function(a){return{k:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},i:";/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("r",function(a){var b="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[a.HCM,{b:b,l:b,k:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[a.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});hljs.registerLanguage("ruby",function(e){var h="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var a={cN:"yardoctag",b:"@[A-Za-z]+"};var i={cN:"comment",v:[{b:"#",e:"$",c:[a]},{b:"^\\=begin",e:"^\\=end",c:[a],r:10},{b:"^__END__",e:"\\n$"}]};var c={cN:"subst",b:"#\\{",e:"}",k:g};var d={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">",r:10},{b:"%[qw]?/",e:"/",r:10},{b:"%[qw]?%",e:"%",r:10},{b:"%[qw]?-",e:"-",r:10},{b:"%[qw]?\\|",e:"\\|",r:10},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]};var b={cN:"params",b:"\\(",e:"\\)",k:g};var f=[d,i,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},i]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:h}),b,i]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[d,{b:h}],r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[i,{cN:"regexp",c:[e.BE,c],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];c.c=f;b.c=f;return{k:g,c:f}});hljs.registerLanguage("haml",function(a){return{cI:true,c:[{cN:"doctype",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},{cN:"comment",b:"^\\s*(!=#|=#|-#|/).*$",r:0},{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"title",b:"\\w+"},{cN:"value",b:"[#\\.]\\w+"},{b:"{\\s*",e:"\\s*}",eE:true,c:[{b:":\\w+\\s*=>",e:",\\s+",rB:true,eW:true,c:[{cN:"symbol",b:":\\w+"},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:true,c:[{b:"\\w+\\s*=",e:"\\s+",rB:true,eW:true,c:[{cN:"attribute",b:"\\w+",r:0},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]},]}]},{cN:"bullet",b:"^\\s*[=~]\\s*",r:0},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("brainfuck",function(b){var a={cN:"literal",b:"[\\+\\-]",r:0};return{c:[{cN:"comment",b:"[^\\[\\]\\.,\\+\\-<> \r\n]",rE:true,e:"[\\[\\]\\.,\\+\\-<> \r\n]",r:0},{cN:"title",b:"[\\[\\]]",r:0},{cN:"string",b:"[\\.,]",r:0},{b:/\+\+|\-\-/,rB:true,c:[a]},a]}});hljs.registerLanguage("matlab",function(a){var b=[a.CNM,{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]}];return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"},{cN:"params",b:"\\[",e:"\\]"}]},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",c:b,r:0},{cN:"cell",b:"\\{",e:"\\}'*[\\.']*",c:b,i:/:/},{cN:"comment",b:"\\%",e:"$"}].concat(b)}});hljs.registerLanguage("vbscript",function(a){return{cI:true,k:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},i:"//",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:/'/,e:/$/,r:0},a.CNM]}});hljs.registerLanguage("fsharp",function(a){return{k:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",c:[{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)"},{cN:"class",bK:"type",e:"\\(|=|$",c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},{cN:"attribute",b:"\\B('[A-Za-z])\\b",c:[a.BE]},a.CLCM,a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("makefile",function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[a.BE]};return{c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b],}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}});hljs.registerLanguage("diff",function(a){return{c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("rib",function(a){return{k:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",i:"/};var c={cN:"string",c:[b.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},b.inherit(b.ASM,{i:null}),b.inherit(b.QSM,{i:null})]};var d={v:[b.BNM,b.CNM]};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[b.CLCM,b.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},a]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:b.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[b.BE]},a,e,{cN:"function",bK:"function",e:/[;{]/,i:"\\$|\\[|%",c:[b.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e,b.CBLCLM,c,d]}]},{cN:"class",bK:"class interface",e:"{",i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});hljs.registerLanguage("cmake",function(a){return{cI:true,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or",operator:"equal less greater strless strgreater strequal matches"},c:[{cN:"envvar",b:"\\${",e:"}"},a.HCM,a.QSM,a.NM]}});hljs.registerLanguage("bash",function(b){var a={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]};var d={cN:"string",b:/"/,e:/"/,c:[b.BE,a,{cN:"variable",b:/\$\(/,e:/\)/,c:[b.BE]}]};var c={cN:"string",b:/'/,e:/'/};return{l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[b.inherit(b.TM,{b:/\w[\w\d_]*/})],r:0},b.HCM,b.NM,d,c,a]}});hljs.registerLanguage("applescript",function(a){var b=a.inherit(a.QSM,{i:""});var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,b]};var c=[{cN:"comment",b:"--",e:"$",},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self",{b:"--",e:"$"}]},a.HCM];return{k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[b,a.CNM,{cN:"type",b:"\\bPOSIX file\\b"},{cN:"command",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"constant",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{cN:"property",b:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{cN:"function_start",bK:"on",i:"[${=;\\n]",c:[a.UTM,d]}].concat(c),i:"//"}});hljs.registerLanguage("vhdl",function(a){return{cI:true,k:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",typename:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},i:"{",c:[a.CBLCLM,{cN:"comment",b:"--",e:"$"},a.QSM,a.CNM,{cN:"literal",b:"'(U|X|0|1|Z|W|L|H|-)'",c:[a.BE]},{cN:"attribute",b:"'[A-Za-z](_?[A-Za-z0-9])*",c:[a.BE]}]}});hljs.registerLanguage("parser3",function(a){return{sL:"xml",r:0,c:[{cN:"comment",b:"^#",e:"$"},{cN:"comment",b:"\\^rem{",e:"}",r:10,c:[{b:"{",e:"}",c:["self"]}]},{cN:"preprocessor",b:"^@(?:BASE|USE|CLASS|OPTIONS)$",r:10},{cN:"title",b:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{cN:"variable",b:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{cN:"keyword",b:"\\^[\\w\\-\\.\\:]+"},{cN:"number",b:"\\^#[0-9a-fA-F]+"},a.CNM]}});hljs.registerLanguage("scala",function(a){var c={cN:"annotation",b:"@[A-Za-z]+"};var b={cN:"string",b:'u?r?"""',e:'"""',r:10};return{k:"type yield lazy override def with val var false true sealed abstract private trait object null if for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},a.CLCM,a.CBLCLM,b,a.ASM,a.QSM,{cN:"class",b:"((case )?class |object |trait )",e:"({|$)",i:":",k:"case class trait object",c:[{bK:"extends with",r:10},a.UTM,{cN:"params",b:"\\(",e:"\\)",c:[a.ASM,a.QSM,b,c]}]},a.CNM,c]}});hljs.registerLanguage("cpp",function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c"],k:b,i:"",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}}); \ No newline at end of file diff --git a/htdocs/includes/DebugBar/Resources/vendor/highlightjs/styles/github.css b/htdocs/includes/DebugBar/Resources/vendor/highlightjs/styles/github.css new file mode 100644 index 00000000000..71967a3739c --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/vendor/highlightjs/styles/github.css @@ -0,0 +1,125 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; padding: 0.5em; + color: #333; + background: #f8f8f8 +} + +.hljs-comment, +.hljs-template_comment, +.diff .hljs-header, +.hljs-javadoc { + color: #998; + font-style: italic +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.javascript .hljs-title, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #333; + font-weight: bold +} + +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #099; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.tex .hljs-formula { + color: #d14 +} + +.hljs-title, +.hljs-id, +.coffeescript .hljs-params, +.scss .hljs-preprocessor { + color: #900; + font-weight: bold +} + +.javascript .hljs-title, +.lisp .hljs-title, +.clojure .hljs-title, +.hljs-subst { + font-weight: normal +} + +.hljs-class .hljs-title, +.haskell .hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #458; + font-weight: bold +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body { + color: #008080 +} + +.hljs-regexp { + color: #009926 +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073 +} + +.hljs-built_in, +.lisp .hljs-title, +.clojure .hljs-built_in { + color: #0086b3 +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold +} + +.hljs-deletion { + background: #fdd +} + +.hljs-addition { + background: #dfd +} + +.diff .hljs-change { + background: #0086b3 +} + +.hljs-chunk { + color: #aaa +} diff --git a/htdocs/includes/DebugBar/Resources/vendor/jquery/dist/jquery.min.js b/htdocs/includes/DebugBar/Resources/vendor/jquery/dist/jquery.min.js new file mode 100644 index 00000000000..4d9b3a25875 --- /dev/null +++ b/htdocs/includes/DebugBar/Resources/vendor/jquery/dist/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("