Merge pull request #12000 from frederic34/zapier2

zapier trigger
This commit is contained in:
Laurent Destailleur 2019-10-01 11:16:27 +02:00 committed by GitHub
commit f151dc1951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 9 deletions

View File

@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
$this->description = "Zapier triggers.";
// 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->picto = 'zapier@zapier';
$this->picto = 'zapier';
}
/**
@ -102,6 +102,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
return 0;
}
$logtriggeraction = false;
$sql = '';
if ($action!='') {
$actions = explode('_', $action);
$sql = 'SELECT rowid, url FROM '.MAIN_DB_PREFIX.'zapier_hook';
@ -460,7 +461,7 @@ function cleanObjectDatas($toclean)
if (isset($toclean->lines) && count($toclean->lines) > 0) {
$nboflines = count($toclean->lines);
for ($i=0; $i < $nboflines; $i++) {
$this->cleanObjectDatas($toclean->lines[$i]);
cleanObjectDatas($toclean->lines[$i]);
}
}

View File

@ -75,7 +75,7 @@ class Contacts extends DolibarrApi
throw new RestException(401, 'No permission to read contacts');
}
if ($id ==0) {
$result = $this->contact->intiAsSpecimen();
$result = $this->contact->initAsSpecimen();
} else {
$result = $this->contact->fetch($id);
}

View File

@ -77,7 +77,7 @@ class Thirdparties extends DolibarrApi
throw new RestException(401);
}
if ($id ==0) {
$result = $this->company->intiAsSpecimen();
$result = $this->company->initAsSpecimen();
} else {
$result = $this->company->fetch($id);
}

View File

@ -210,7 +210,8 @@ class ZapierApi extends DolibarrApi
$sql.= $db->plimit($limit + 1, $offset);
}
$result = $db->query($sql);
$result = $db->query($sql);
$i = 0;
if ($result) {
$num = $db->num_rows($result);
while ($i < $num) {
@ -240,9 +241,6 @@ class ZapierApi extends DolibarrApi
*/
public function post($request_data = null)
{
// $debug = '<pre>'.print_r($request_data, true).'</pre>';
// $debug .= '<pre>'.print_r(DolibarrApiAccess::$user->rights->zapier, true).'</pre>';
// mail('frederic.france@free.fr', 'test hook', $debug);
if (! DolibarrApiAccess::$user->rights->zapier->write) {
throw new RestException(401);
}

View File

@ -196,7 +196,7 @@ if ($object->id > 0)
print '<div class="underbanner clearboth"></div>';
$object->info($object->id);
print dol_print_object_info($object, 1);
dol_print_object_info($object, 1);
print '</div>';