From 96f16b74975b2b7730056012ff54ffa58e7e74ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Aug 2018 17:29:05 +0200 Subject: [PATCH 01/21] Update commondocgenerator.class.php --- .../core/class/commondocgenerator.class.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 78e13a92b5f..e4cc748f4f2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -578,15 +578,15 @@ abstract class CommonDocGenerator } // Retrieve extrafields - /*if(is_array($object->array_options) && count($object->array_options)) + if(is_array($object->array_options) && count($object->array_options)) { require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label('shipment',true); + $extralabels = $extrafields->fetch_name_optionals_label('expedition',true); $object->fetch_optionals($object->id,$extralabels); $array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs); - }*/ + } return $array_shipment; } @@ -603,7 +603,7 @@ abstract class CommonDocGenerator global $conf; dol_include_once('/core/lib/product.lib.php'); - return array( + $resarray = array( 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), 'line_product_ref'=>$line->product_ref, 'line_product_label'=>$line->product_label, @@ -622,6 +622,18 @@ abstract class CommonDocGenerator 'line_surface'=>empty($line->surface) ? '' : $line->surface*$line->qty_shipped.' '.measuring_units_string($line->surface_units, 'surface'), 'line_volume'=>empty($line->volume) ? '' : $line->volume*$line->qty_shipped.' '.measuring_units_string($line->volume_units, 'volume'), ); + + // Retrieve extrafields + $extrafieldkey = $line->element; + $array_key = "line"; + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true); + $line->fetch_optionals($line->rowid, $extralabels); + + $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); + + return $resarray; } From 343e6ce8b3ba610f4199421d9d1b35cfa54c8b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Aug 2018 14:34:27 +0200 Subject: [PATCH 02/21] typo --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f5209421694..1adcf7376c5 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -894,7 +894,7 @@ class ActionComm extends CommonObject $val=array('id'=>$val); } $sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)"; - $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; + $sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")"; $resql = $this->db->query($sql); if (! $resql) From 58d339597b581e8933b80b0d5abe0eea9d3316f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Aug 2018 15:44:33 +0200 Subject: [PATCH 03/21] Create index.html --- htdocs/dav/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/dav/index.html diff --git a/htdocs/dav/index.html b/htdocs/dav/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/dav/index.html @@ -0,0 +1 @@ + From 89d55f3b4693960492e87d24fbc89810d343f330 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Aug 2018 11:45:22 +0200 Subject: [PATCH 04/21] Fix lib in modulebuilder --- htdocs/modulebuilder/index.php | 11 ++++++----- .../{myobject.lib.php => mymodule_myobject.lib.php} | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 2 +- htdocs/modulebuilder/template/myobject_note.php | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) rename htdocs/modulebuilder/template/lib/{myobject.lib.php => mymodule_myobject.lib.php} (97%) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e844793b601..d406f6918a0 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -121,13 +121,13 @@ if ($dirins && $action == 'initmodule' && $modulename) } } - // Delete some files + // Delete some files related to object (because to previous dolCopyDir has copied everything) dol_delete_file($destdir.'/myobject_card.php'); dol_delete_file($destdir.'/myobject_note.php'); dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); - dol_delete_file($destdir.'/lib/myobject.lib.php'); + dol_delete_file($destdir.'/lib/mymodule_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject.sql'); dol_delete_file($destdir.'/sql/llx_mymodule_myobject_extrafields.sql'); @@ -279,14 +279,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) if (! $error) { - // Delete some files + // Copy some files $filetogenerate = array( 'myobject_card.php'=>strtolower($objectname).'_card.php', 'myobject_note.php'=>strtolower($objectname).'_note.php', 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', @@ -648,7 +648,8 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) 'myobject_document.php'=>strtolower($objectname).'_document.php', 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/myobject.lib.php'=>'lib/'.strtolower($objectname).'.lib.php', + 'lib/mymodule.lib.php'=>'lib/'.strtolower($module).'.lib.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', 'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.$objectname.'Test.php', 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', diff --git a/htdocs/modulebuilder/template/lib/myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php similarity index 97% rename from htdocs/modulebuilder/template/lib/myobject.lib.php rename to htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index d3665dff236..dbf049b3827 100644 --- a/htdocs/modulebuilder/template/lib/myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/modulebuilder/template/lib/myobject.lib.php + * \file htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php * \ingroup mymodule * \brief Library files with common functions for MyObject */ diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 5c7303ba6a9..3322fb527d3 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index cfc79b2f232..78a9070eefd 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -60,7 +60,7 @@ if (! $res) die("Include of main fails"); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","other")); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index c08a360835a..dfdc16d69d9 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -42,7 +42,7 @@ 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/html.formfile.class.php'; dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies","other","mails")); diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 5b438c32a7c..1a26d9abeb4 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -38,7 +38,7 @@ if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main if (! $res) die("Include of main fails"); dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/myobject.lib.php'); +dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); // Load translation files required by the page $langs->loadLangs(array("mymodule@mymodule","companies")); From 085f8cf604e32630bf3ed12b49545471a68db847 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Aug 2018 11:51:06 +0200 Subject: [PATCH 05/21] Fix bad link --- htdocs/modulebuilder/template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index d745c808bf4..04f3ff0f356 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -13,7 +13,7 @@ Other modules are available on