From aa08e3276140499836516baf59feb7ac172cef5b Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 28 Jan 2019 04:48:59 +0100 Subject: [PATCH 01/13] Add links and related documents for a stock movement @eldy you can clone in movement_card.php if you prefer this structure --- htdocs/product/stock/movement_list.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 68ad4d96789..ce77f120db4 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -403,12 +403,12 @@ if ($action == "transfert_stock" && ! $cancel) /* * Build document */ -/* The builddoc action for object of a movement must be on the movement card +// The builddoc action for object of a movement must be on the movement card // Actions to build doc -$upload_dir = $conf->stock->dir_output; +$upload_dir = $conf->stock->dir_output . "movement/"; $permissioncreate = $user->rights->stock->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; -*/ + if (empty($reshook) && $action != 'remove_file') { @@ -416,7 +416,7 @@ if (empty($reshook) && $action != 'remove_file') $objectlabel='Movements'; $permtoread = $user->rights->stock->lire; $permtodelete = $user->rights->stock->supprimer; - $uploaddir = $conf->stock->dir_output; + $uploaddir = $conf->stock->dir_output . "/movement/"; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -1145,8 +1145,8 @@ else /* * Documents generes */ -/* Area for doc and last events of warehouse are stored on the main card of warehouse -$modulepart='mouvement'; +//Area for doc and last events of warehouse are stored on the main card of warehouse +$modulepart='movement'; if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) { @@ -1183,11 +1183,11 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'stock', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product + $somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product print ''; } -*/ + // End of page llxFooter(); From 49ccdb96027960ad4f583ddf10cc403c35ba9b13 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 28 Jan 2019 05:06:02 +0100 Subject: [PATCH 02/13] Update movement_list.php For it to work you have to create this script htdocs\core\modules\stock\doc\pdf_stdmouvement.modules.php instead htdocs\core\modules\stock\doc\pdf_stdmovement.modules.php this mixture of fr/en confused me and I'm sure you better control the structure to make it work properly it tested & works but with htdocs\core\modules\stock\doc\pdf_stdmouvement.modules.php thx --- htdocs/product/stock/movement_list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index ce77f120db4..4435ea98f42 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1160,14 +1160,14 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) if(!empty($search_inventorycode)) $objectref.="_".$id."_".$search_inventorycode; if($search_type_mouvement) $objectref.="_".$search_type_mouvement; $relativepath = $comref . '/' . $objectref . '.pdf'; - $filedir = $conf->stock->dir_output . '/movement/' . $objectref; + $filedir = $conf->stock->dir_output . '/' . $modulepart .'/' . $objectref; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id."&search_inventorycode=".$search_inventorycode."&search_type_mouvement=$search_type_mouvement"; $genallowed=$usercanread; $delallowed=$usercancreate; - $genallowed=$user->rights->stock->mouvement->lire; - $delallowed=$user->rights->stock->mouvement->creer; + $genallowed=$user->rights->stock->lire; + $delallowed=$user->rights->stock->creer; print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); $somethingshown=$formfile->numoffiles; @@ -1183,7 +1183,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product + $somethingshown = $formactions->showactions($object, $modulepart, 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product print ''; } From 8546c801a568b73021fa182baf5536b62151845e Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 28 Jan 2019 05:17:09 +0100 Subject: [PATCH 03/13] to make it work with movement_card.php --- htdocs/product/stock/movement_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 4435ea98f42..b790226cc61 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1031,7 +1031,7 @@ if ($resql) { // Inventory code print ''.'stock->dir_output . "movement/"; -$permissioncreate = $user->rights->stock->creer; -include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - - -if (empty($reshook) && $action != 'remove_file') -{ - $objectclass='MouvementStock'; - $objectlabel='Movements'; - $permtoread = $user->rights->stock->lire; - $permtodelete = $user->rights->stock->supprimer; - $uploaddir = $conf->stock->dir_output . "/movement/"; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} - - - /* * View */ @@ -1141,54 +1119,6 @@ else } - -/* - * Documents generes - */ -//Area for doc and last events of warehouse are stored on the main card of warehouse -$modulepart='movement'; - -if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0) -{ - print '
'; - print '
'; - print ''; // ancre - - // Documents - $objectref = dol_sanitizeFileName($object->ref); - // Add inventorycode & type_mouvement to filename of the pdf - if(!empty($search_inventorycode)) $objectref.="_".$id."_".$search_inventorycode; - if($search_type_mouvement) $objectref.="_".$search_type_mouvement; - $relativepath = $comref . '/' . $objectref . '.pdf'; - $filedir = $conf->stock->dir_output . '/' . $modulepart .'/' . $objectref; - - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id."&search_inventorycode=".$search_inventorycode."&search_type_mouvement=$search_type_mouvement"; - $genallowed=$usercanread; - $delallowed=$usercancreate; - - $genallowed=$user->rights->stock->lire; - $delallowed=$user->rights->stock->creer; - - print $formfile->showdocuments($modulepart,$objectref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object); - $somethingshown=$formfile->numoffiles; - - print '
'; - - $MAXEVENT = 10; - - $morehtmlright = ''; - $morehtmlright.= $langs->trans("SeeAll"); - $morehtmlright.= ''; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; - $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, $modulepart, 0, 1, '', $MAXEVENT, '', $morehtmlright); // Show all action for product - - print '
'; -} - - // End of page llxFooter(); $db->close(); From d1716babeffefcea5dc580aea0258ff4aa257bf4 Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Wed, 27 Feb 2019 11:17:33 +0100 Subject: [PATCH 05/13] disable the auto renaming on upload add a global variable for disable the auto renaming on upload file corresponds to the request of this post : https://www.dolibarr.fr/forum/12-howto--aide/55094-fichiers-joints-decocher-la-case-sauver-sous#107392 --- htdocs/core/class/html.formfile.class.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c53a5562997..52336e3759e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -72,7 +72,7 @@ class FormFile * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). * Deprecated 2 should never be used and if 1 is used, option should no be enabled. - * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param string $dodocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') @@ -174,14 +174,17 @@ class FormFile $out .= ""; if ($savingdocmask) - { - $out .= ''; - if (! empty($options)) $out .= ''.$options.''; - $out .= ''; - $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/', $langs->transnoentitiesnoconv("OriginFileName"), $savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); - $out .= ''; - $out .= ''; - } + { + //add a global variable for disable the auto renaming on upload + if($conf->global->MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT==1){$rename='';}else{$rename='checked';} + + $out .= ''; + if (! empty($options)) $out .= ''.$options.''; + $out .= ''; + $out .= ' '.$langs->trans("SaveUploadedFileWithMask", preg_replace('/__file__/',$langs->transnoentitiesnoconv("OriginFileName"),$savingdocmask), $langs->transnoentitiesnoconv("OriginFileName")); + $out .= ''; + $out .= ''; + } $out .= ""; From f2dc6872029c4ea6df2791fa6eea1f58cb3287d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2019 13:26:37 +0100 Subject: [PATCH 06/13] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 52336e3759e..7d18d7e3a5d 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -176,7 +176,13 @@ class FormFile if ($savingdocmask) { //add a global variable for disable the auto renaming on upload - if($conf->global->MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT==1){$rename='';}else{$rename='checked';} + if (! empty($conf->global->MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT)) + { + $rename=''; + } + else { + $rename='checked'; + } $out .= ''; if (! empty($options)) $out .= ''.$options.''; From 8ea475df642346037db16d019c7ade286c82ed1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 27 Feb 2019 16:11:19 +0100 Subject: [PATCH 07/13] Update establishment.class.php --- htdocs/hrm/class/establishment.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 467201940ce..f39a9ee374a 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -396,7 +396,7 @@ class Establishment extends CommonObject * Get on record Establishment * * @param int $id Id of record - * @return obj + * @return Object */ function getEstablishment($id) { @@ -457,7 +457,7 @@ class Establishment extends CommonObject */ function getNomUrlParent($id = 0, $withpicto = 0) { - global $langs; + global $langs, $conf; $result=''; From 8e8c68345a54446db864bccc682d675fe34c471e Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Wed, 27 Feb 2019 21:41:55 +0100 Subject: [PATCH 08/13] phpcs simplification --- htdocs/core/class/html.formfile.class.php | 24 ++++++++--------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c53a5562997..d2c2b6d17a3 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1555,22 +1555,14 @@ class FormFile $id=0; $ref=''; $label=''; // To show ref or specific information according to view to show (defined by $module) - if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices - elseif ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'supplier_proposal') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'order') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'order_supplier') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'contract') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'product') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } - elseif ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} - elseif ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} - elseif ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');} - elseif ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:'');} - elseif ($modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:'');} - + if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } + elseif ($modulepart == 'invoice_supplier') { preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); if (is_numeric($ref)) { $id=$ref; $ref=''; } } // $ref may be also id with old supplier invoices + elseif ($modulepart == 'user' || $modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $id=(isset($reg[1])?$reg[1]:''); } + elseif (in_array($modulepart, array('invoice', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'project', 'fichinter', 'expensereport'))) + { + preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg); $ref=(isset($reg[1])?$reg[1]:''); + } + if (! $id && ! $ref) continue; $found=0; if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) From b8b55fb748624d2be946ce82cea1d20ca5714549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 10:30:27 +0100 Subject: [PATCH 09/13] WIP Add IFTTT module --- build/rpm/dolibarr_fedora.spec | 1 + build/rpm/dolibarr_generic.spec | 1 + build/rpm/dolibarr_mandriva.spec | 1 + build/rpm/dolibarr_opensuse.spec | 1 + htdocs/core/modules/modIFTTT.class.php | 251 ++++++++++++++++++ .../interface_50_modIFTTT_IFTTT.class.php | 125 +++++++++ ...terface_50_modTicket_TicketEmail.class.php | 2 + htdocs/ifttt/README.md | 7 + htdocs/ifttt/admin/index.php | 131 +++++++++ 9 files changed, 520 insertions(+) create mode 100644 htdocs/core/modules/modIFTTT.class.php create mode 100644 htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php create mode 100644 htdocs/ifttt/README.md create mode 100644 htdocs/ifttt/admin/index.php diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index b6d526bf8e1..881b5b1a6a4 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -191,6 +191,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ftp %_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/hrm +%_datadir/dolibarr/htdocs/ifttt %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 32c6e50018e..74d6bf700bb 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -271,6 +271,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ftp %_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/hrm +%_datadir/dolibarr/htdocs/ifttt %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index dbb8e0d1310..181bdb4ded4 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -188,6 +188,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ftp %_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/hrm +%_datadir/dolibarr/htdocs/ifttt %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index aa810a737b9..1410e5097cf 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -199,6 +199,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/ftp %_datadir/dolibarr/htdocs/holiday %_datadir/dolibarr/htdocs/hrm +%_datadir/dolibarr/htdocs/ifttt %_datadir/dolibarr/htdocs/imports %_datadir/dolibarr/htdocs/includes %_datadir/dolibarr/htdocs/install diff --git a/htdocs/core/modules/modIFTTT.class.php b/htdocs/core/modules/modIFTTT.class.php new file mode 100644 index 00000000000..55739978715 --- /dev/null +++ b/htdocs/core/modules/modIFTTT.class.php @@ -0,0 +1,251 @@ + + * + * 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 . + */ + +/** + * \defgroup ifttt Module IFTTT + * \brief Descriptor file for IFTTT module + * \file htdocs/core/modules/modIFTTT.class.php + * \ingroup ifttt + * \brief Description and activation file for module IFTTT + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + + +/** + * Description and activation class for module IFTTT + */ +class modIFTTT extends DolibarrModules +{ + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). + $this->numero = 2620; + // Key text used to identify module (for permissions, menus, etc...) + $this->rights_class = 'ifttt'; + + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page + $this->family = "interface"; + // 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)); + // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) + $this->description = "IFTTT interface"; + // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version + $this->version = 'development'; + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Can be enabled / disabled only in the main company with superadmin account + $this->core_enabled = 1; + // Name of image file used for this module. + // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' + // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' + $this->picto='technic'; + + $this->module_parts = array(); + + // Data directories to create when module is enabled. + // Example: this->dirs = array("/api/temp"); + $this->dirs = array(); + + // Config pages. Put here list of php page, stored into api/admin directory, to use to setup module. + $this->config_page_url = array("index.php@ifttt"); + + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module + $this->langfiles = array("other"); + + // Constants + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array(0=>array('MYMODULE_MYNEWCONST1','chaine','myvalue','This is a constant to add',1), + // 1=>array('MYMODULE_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) + // ); + $this->const = array(); + + // Array to add new pages in new tabs + // Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@api:$user->rights->ifttt->read:/api/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1 + // 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@api:$user->rights->othermodule->read:/api/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // where objecttype can be + // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) + // 'contact' to add a tab in contact view + // 'contract' to add a tab in contract view + // 'group' to add a tab in group view + // 'intervention' to add a tab in intervention view + // 'invoice' to add a tab in customer invoice view + // 'invoice_supplier' to add a tab in supplier invoice view + // 'member' to add a tab in fundation member view + // 'opensurveypoll' to add a tab in opensurvey poll view + // 'order' to add a tab in customer order view + // 'order_supplier' to add a tab in supplier order view + // 'payment' to add a tab in payment view + // 'payment_supplier' to add a tab in supplier payment view + // 'product' to add a tab in product view + // 'propal' to add a tab in propal view + // 'project' to add a tab in project view + // 'stock' to add a tab in stock view + // 'thirdparty' to add a tab in third party view + // 'user' to add a tab in user view + $this->tabs = array(); + + // Dictionaries + if (! isset($conf->ifttt->enabled)) + { + $conf->ifttt=new stdClass(); + $conf->ifttt->enabled=0; + } + $this->dictionaries=array(); + + // Boxes + // Add here list of php file(s) stored in core/boxes that contains class to show a box. + $this->boxes = array(); // List of boxes + // Example: + //$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>''));); + + // Permissions + $this->rights = array(); // Permission array used by this module + $r=0; + + // Add here list of permission defined by an id, a label, a boolean and two constant strings. + // Example: + // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) + // $this->rights[$r][1] = 'Permision label'; // Permission label + // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + // $r++; + + + // Main menu entries + $this->menu = array(); // List of menus to add + $r=0; + + // Add here entries to declare new menus + // + // Example to declare a new Top Menu entry and its Left menu entry: + // $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu + // 'type'=>'top', // This is a Top menu entry + // 'titre'=>'Api top menu', + // 'mainmenu'=>'api', + // 'leftmenu'=>'api', + // 'url'=>'/api/pagetop.php', + // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position'=>100, + // 'enabled'=>'$conf->ifttt->enabled', // Define condition to show or hide menu entry. Use '$conf->ifttt->enabled' if entry must be visible if module is enabled. + // 'perms'=>'1', // Use 'perms'=>'$user->rights->ifttt->level1->level2' if you want your menu with a permission rules + // 'target'=>'', + // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + // $r++; + // + // Example to declare a Left Menu entry into an existing Top menu entry: + // $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + // 'type'=>'left', // This is a Left menu entry + // 'titre'=>'Api left menu', + // 'mainmenu'=>'xxx', + // 'leftmenu'=>'api', + // 'url'=>'/api/pagelevel2.php', + // 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + // 'position'=>100, + // 'enabled'=>'$conf->ifttt->enabled', // Define condition to show or hide menu entry. Use '$conf->ifttt->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + // 'perms'=>'1', // Use 'perms'=>'$user->rights->ifttt->level1->level2' if you want your menu with a permission rules + // 'target'=>'', + // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + // $r++; + + + // Exports + $r=1; + + // Example: + // $this->export_code[$r]=$this->rights_class.'_'.$r; + // $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + // $this->export_enabled[$r]='1'; // Condition to show export in list (ie: '$user->id==3'). Set to 1 to always show when module is enabled. + // $this->export_permission[$r]=array(array("facture","facture","export")); + // $this->export_fields_array[$r]=array( + // 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone', + // 's.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode', + // 's.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation", + // 'f.datef'=>"DateInvoice",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus', + // 'f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate", + // 'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalTVA",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart", + // 'fd.date_end'=>"DateEnd",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef' + //); + // $this->export_entities_array[$r]=array( + // 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company', + // 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company', + // 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice", + // 'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.price'=>"invoice_line", + // 'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line", + // 'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.fk_product'=>'product','p.ref'=>'product' + //); + // $this->export_sql_start[$r]='SELECT DISTINCT '; + // $this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'facture as f, '.MAIN_DB_PREFIX.'facturedet as fd, '.MAIN_DB_PREFIX.'societe as s)'; + // $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; + // $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture'; + // $this->export_sql_order[$r] .=' ORDER BY s.nom'; + // $r++; + } + + /** + * 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 + */ + function init($options = '') + { + $sql = array(); + + $result=$this->_load_tables('/ifttt/sql/'); + + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted. + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function remove($options = '') + { + // Remove old constants with entity fields different of 0 + $sql = array( + "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('MAIN_MODULE_IFTTT', 1), + "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = ".$this->db->encrypt('IFTTT_PRODUCTION_MODE', 1) + ); + + return $this->_remove($sql, $options); + } +} diff --git a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php new file mode 100644 index 00000000000..3bf45ea3848 --- /dev/null +++ b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php @@ -0,0 +1,125 @@ + + * 2016 Christophe Battarel + * + * 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/triggers/interface_50_modIFTTT_IFTTT.class.php + * \ingroup core + * \brief File of trigger for IFTTT module + */ +require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; + + +/** + * Class of triggers for IFTTT module + */ +class InterfaceIFTTT extends DolibarrTriggers +{ + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + + $this->name = preg_replace('/^Interface/i', '', get_class($this)); + $this->family = "ifttt"; + $this->description = "Triggers of the module IFTTT"; + $this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version + $this->picto = 'ifttt'; + } + + /** + * Return name of trigger file + * + * @return string Name of trigger file + */ + public function getName() + { + return $this->name; + } + + /** + * Return description of trigger file + * + * @return string Description of trigger file + */ + public function getDesc() + { + return $this->description; + } + + /** + * Return version of trigger file + * + * @return string Version of trigger file + */ + public function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'development') { + return $langs->trans("Development"); + } elseif ($this->version == 'experimental') { + return $langs->trans("Experimental"); + } elseif ($this->version == 'dolibarr') { + return DOL_VERSION; + } elseif ($this->version) { + return $this->version; + } else { + return $langs->trans("Unknown"); + } + } + + /** + * Function called when a Dolibarrr business event is done. + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers + * + * @param string $action Event action code + * @param Object $object Object + * @param User $user Object user + * @param Translate $langs Object langs + * @param conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK + */ + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) + { + $ok = 0; + + if (empty($conf->ifttt->enabled)) return 0; // Module not active, we do nothing + + switch ($action) { + case 'THIRDPARTY_CREATED': + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + + // TODO + + break; + } + + return $ok; + } +} diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index f8f5595887d..c8a31a70e40 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -109,6 +109,8 @@ class InterfaceTicketEmail extends DolibarrTriggers { $ok = 0; + if (empty($conf->ticket->enabled)) return 0; // Module not active, we do nothing + switch ($action) { case 'TICKET_ASSIGNED': dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); diff --git a/htdocs/ifttt/README.md b/htdocs/ifttt/README.md new file mode 100644 index 00000000000..581853f80c6 --- /dev/null +++ b/htdocs/ifttt/README.md @@ -0,0 +1,7 @@ +API REST +======== + +## Integrate your ERP with any other applications using IFTTT + +This module provides the triggers and services to make Dolibarr compatible with IFTTT Services. + diff --git a/htdocs/ifttt/admin/index.php b/htdocs/ifttt/admin/index.php new file mode 100644 index 00000000000..d6eb777109b --- /dev/null +++ b/htdocs/ifttt/admin/index.php @@ -0,0 +1,131 @@ + + * Copyright (C) 2005-2016 Laurent Destailleur + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2012-2018 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/ifttt/admin/index.php + * \ingroup api + * \brief Page to setup IFTTT module + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + +// Load translation files required by the page +$langs->load("admin"); + +if (! $user->admin) + accessforbidden(); + +$action=GETPOST('action', 'aZ09'); + + +if ($action == 'setproductionmode') +{ + $status = GETPOST('status', 'alpha'); + + if (dolibarr_set_const($db, 'IFTTT_PRODUCTION_MODE', $status, 'chaine', 0, '', 0) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + + +/* + * View + */ + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("IFTTTSetup"), $linkback, 'title_setup'); + +print $langs->trans("IFTTTDesc")."
\n"; +print "
\n"; + +//print '
'; +print ''; +print ''; + +print ''; +print ""; +print '"; +print ""; +print ""; + +print ''; +print ''; +$production_mode=(empty($conf->global->IFTTT_PRODUCTION_MODE)?false:true); +if ($production_mode) +{ + print ''; +} +else +{ + print ''; +} +print ''; +print ''; + +print '
".$langs->trans("Parameter")."'.$langs->trans("Value")." 
'.$langs->trans("ProductionMode").''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' 
'; +print '

'; + +/* + +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + +// Show message +$message=''; +$url=$urlwithroot.'/api/index.php/login?login=auserlogin&password=thepassword[&reset=1]'; +$message.=$langs->trans("UrlToGetKeyToUseAPIs").':
'; +$message.=img_picto('', 'object_globe.png').' '.$url; +print $message; +print '
'; +print '
'; + +// Explorer +print ''.$langs->trans("ApiExporerIs").':
'; +if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer')) +{ + $url=DOL_MAIN_URL_ROOT.'/api/index.php/explorer'; + print img_picto('', 'object_globe.png').' '.$url."
\n"; +} +else +{ + print $langs->trans("NotAvailableWithThisDistribution"); +} + +*/ + +llxFooter(); +$db->close(); From c444521abcb4ea1466c6a29b80a6b0807dcecdd7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:00:40 +0100 Subject: [PATCH 10/13] IFTTT --- htdocs/core/lib/geturl.lib.php | 5 ++++ .../interface_50_modIFTTT_IFTTT.class.php | 24 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 69da66fa99c..9a78e7a3dbf 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -78,6 +78,11 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = curl_setopt($ch, CURLOPT_POST, 1); // POST curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // Setting param x=a&y=z as POST fields } + elseif ($postorget == 'POSTALREADYFORMATED') + { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); // HTTP request is 'POST' but param string is taken as it is + curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string + } elseif ($postorget == 'PUT') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT' diff --git a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php index 3bf45ea3848..67379019e0b 100644 --- a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php +++ b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php @@ -115,8 +115,30 @@ class InterfaceIFTTT extends DolibarrTriggers case 'THIRDPARTY_CREATED': dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - // TODO + include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; + // See https://platform.ifttt.com/docs/api_reference#realtime-api + + $arrayofdata=array(); + $arrayofdata['user_id']=$conf->global->IFTTT_USER_ID; + $arrayofdata['trigger_identity']=$conf->global->IFTTT_TRIGGER_IDENTITY; + $arrayofdata['name']='testabcdef'; + $arrayofdata['email']='testemailabcdef'; + + $url = 'https://realtime.ifttt.com/v1/notifications'; + + $addheaders=array( + 'IFTTT-Service-Key'=>'123', + 'Accept'=>'application/json', + 'Accept-Charset'=>'utf-8', + 'Accept-Encoding'=>'gzip, deflate', + 'Content-Type'=>'application/json', + 'X-Request-ID'=>getRandomPassword(true, null) + ) + + $result = getURLContent($url, 'POSTALREADYFORMATED', '', 1, $addheaders); + + $ok = 1; break; } From a58e3dc9bcf2473927a4ec1e106a656b43422021 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:12:02 +0100 Subject: [PATCH 11/13] FIX #10711 Try to init the hook at a higher level --- htdocs/cron/class/cronjob.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index eaff511a779..b4289f60f36 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -953,7 +953,9 @@ class Cronjob extends CommonObject function run_jobs($userlogin) { // phpcs:enable - global $langs, $conf; + global $langs, $conf, $hookmanager; + + $hookmanager->initHooks(array('cron')); $now=dol_now(); $error = 0; From c240c66789861ac49d5206b8edd427456851cb07 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:17:43 +0100 Subject: [PATCH 12/13] Update html.formfile.class.php --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7d18d7e3a5d..3d1fe06d462 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -72,7 +72,7 @@ class FormFile * @param string $options Add an option column * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). * Deprecated 2 should never be used and if 1 is used, option should no be enabled. - * @param string $dodocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' + * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM) * @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*') From 488004026f37a80d9d0a13819b7a88572643f57a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Feb 2019 11:28:10 +0100 Subject: [PATCH 13/13] Fix syntax error --- htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php index 67379019e0b..c7ce8f121fc 100644 --- a/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php +++ b/htdocs/core/triggers/interface_50_modIFTTT_IFTTT.class.php @@ -134,7 +134,7 @@ class InterfaceIFTTT extends DolibarrTriggers 'Accept-Encoding'=>'gzip, deflate', 'Content-Type'=>'application/json', 'X-Request-ID'=>getRandomPassword(true, null) - ) + ); $result = getURLContent($url, 'POSTALREADYFORMATED', '', 1, $addheaders);