kopia lustrzana https://github.com/newroco/mail2deck
update function for assigning user
rodzic
bee453e316
commit
25d9b0e6ba
|
|
@ -88,7 +88,8 @@ class CreateCardClass{
|
|||
if($data->attachments){
|
||||
$imageUrls = $newcard->addAttachments($response, $data->attachments);
|
||||
if (!empty($imageUrls)) {
|
||||
$newcard->updateCardDescription($response, $imageUrls);
|
||||
$newDescription =$newcard->updateCardDescription($response, $imageUrls);
|
||||
$response->description= $newDescription;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ class DeckClass {
|
|||
];
|
||||
|
||||
$this->apiCall("PUT",NC_SERVER . "/index.php/apps/deck/api/v1.0/boards/{$card->board}/stacks/{$card->stack}/cards/{$card->id}",$data);
|
||||
return $newDescription;
|
||||
}
|
||||
|
||||
//Assign a user to the card
|
||||
|
|
@ -199,11 +200,10 @@ class DeckClass {
|
|||
$adminPassword = urlencode(NC_ADMIN_PASSWORD);
|
||||
|
||||
$url = "https://{$adminUser}:{$adminPassword}@" . NC_HOST;
|
||||
$allUsers= $this->apiCall("GET",$url."/ocs/v1.php/cloud/users", null, false, true); //nextcloud user list
|
||||
|
||||
foreach ($allUsers->data->users->element as $userId) {
|
||||
$userDetails = $this->apiCall("GET",$url."/ocs/v1.php/cloud/users/{$userId}",null, false, true);//search in the nextcloud user list
|
||||
if (isset($userDetails->data->email[0]) && $userDetails->data->email[0] == $mailUser) {
|
||||
$allUsers= $this->apiCall("GET",$url."/ocs/v1.php/cloud/users"); //nextcloud user list
|
||||
foreach ($allUsers->ocs->data->users as $userId) {
|
||||
$userDetails = $this->apiCall("GET",$url."/ocs/v1.php/cloud/users/{$userId}");//search in the nextcloud user list
|
||||
if (isset($userDetails->ocs->data->email) && $userDetails->ocs->data->email == $mailUser) {
|
||||
$this->apiCall("PUT", NC_SERVER . "/index.php/apps/deck/api/v1.0/boards/{$card->board}/stacks/{$card->stack}/cards/{$card->id}/assignUser", ['userId' => (string)$userId]);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,15 +105,7 @@ class MailClass {
|
|||
if (preg_match($pattern, $description)) {
|
||||
$descriptionFormatted = preg_replace('/\[(.*?)\]\((.*?)\)/', '<img src="$2" alt="$1">', $description);
|
||||
}else{
|
||||
$descriptionFormatted = $description;
|
||||
|
||||
//Attachements
|
||||
$attachments = $response->attachments;
|
||||
if (!empty($attachments)) {
|
||||
foreach ($attachments as $attachment) {
|
||||
$descriptionFormatted .= "<br><a href=\"".NC_SERVER ."/remote.php/dav/files/".NC_USER."/Deck/".$attachment. "\" target='_blank'>$attachment</a><br>";
|
||||
}
|
||||
}
|
||||
$descriptionFormatted = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="$2" target="_blank">$1</a>', $description);
|
||||
}
|
||||
|
||||
$bodySupport="<p><a href=\"" . NC_SERVER . "/index.php/apps/deck/board/{$response->board}/card/{$response->id}" . "\">{$response->title}</a></p>"
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue