diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index 57761bb6fe2..a22a40a56ef 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -473,40 +473,6 @@ class modWebhook extends DolibarrModules $sql = array(); - // Document templates - $moduledir = dol_sanitizeFileName('webhook'); - $myTmpObjects = array(); - $myTmpObjects['Webhook_target'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); - - foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { - if ($myTmpObjectKey == 'Webhook_target') { - continue; - } - if ($myTmpObjectArray['includerefgeneration']) { - $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_webhook_targets.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; - $dest = $dirodt.'/template_webhook_targets.odt'; - - if (file_exists($src) && !file_exists($dest)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - dol_mkdir($dirodt); - $result = dol_copy($src, $dest, 0, 0); - if ($result < 0) { - $langs->load("errors"); - $this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest); - return 0; - } - } - - $sql = array_merge($sql, array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity), - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")", - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity), - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")" - )); - } - } - return $this->_init($sql, $options); } diff --git a/htdocs/zapier/class/api_zapier.class.php b/htdocs/zapier/class/api_zapier.class.php index c98f3bab6c7..8243d3a2328 100644 --- a/htdocs/zapier/class/api_zapier.class.php +++ b/htdocs/zapier/class/api_zapier.class.php @@ -19,7 +19,7 @@ /** * \file htdocs/zapier/class/api_zapier.class.php * \ingroup zapier - * \brief File for API management of hook. + * \brief File for API management of Zapier hooks. */ use Luracast\Restler\RestException; @@ -260,7 +260,7 @@ class Zapier extends DolibarrApi $this->hook->$field = $value; } $this->hook->fk_user = DolibarrApiAccess::$user->id; - // on crée le hook dans la base + // we create the hook into database if (!$this->hook->create(DolibarrApiAccess::$user)) { throw new RestException(500, "Error creating Hook", array_merge(array($this->hook->error), $this->hook->errors)); } diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 9b5b7335559..d63271ce54e 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -18,7 +18,7 @@ /** * \file htdocs/zapier/class/hook.class.php * \ingroup zapier - * \brief This file is a CRUD class file for Hook (Create/Read/Update/Delete) + * \brief This file is a CRUD class file for Zapier Hook record (Create/Read/Update/Delete) */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -636,7 +636,6 @@ class Hook extends CommonObject $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; - $this->user_creation_id = $obj->fk_user_creat; $this->user_modification_id = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->datec); @@ -659,49 +658,4 @@ class Hook 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() - { - 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; - } } - -/** - * Class MyObjectLine. You can also remove this and generate a CRUD class for lines objects. - */ -/* -class MyObjectLine -{ - // @var int ID - public $id; - // @var mixed Sample line property 1 - public $prop1; - // @var mixed Sample line property 2 - public $prop2; -} -*/