Skip to content

Commit

Permalink
FULL_BILLING_URL and TASKMAN_SEND_TASKURL options implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyza committed Oct 18, 2021
1 parent c35385f commit cb19357
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1 rev 8160
1.2.1 rev 8161
17 changes: 16 additions & 1 deletion api/libs/api.taskman.php
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,18 @@ function ts_CreateTask($startdate, $starttime, $address, $login, $phone, $jobtyp
}
}

//some hack to append UKV users cable seals
//some hack to append UKV users cable seals and maybe something else
if (wf_CheckPost(array('unifiedformtelegramappend'))) {
$newTelegramText .= $_POST['unifiedformtelegramappend'];
}

//appending task direct URL to task
$fullBillingUrl = $ubillingConfig->getAlterParam('FULL_BILLING_URL');
$appendTaskLinkFlag = $ubillingConfig->getAlterParam('TASKMAN_SEND_TASKURL');
if (!empty($fullBillingUrl) AND $appendTaskLinkFlag) {
$newTelegramText .= '<a href="' . $fullBillingUrl . '/?module=taskman&edittask=' . $taskid . '">🔍 ' . __('View task') . '</a> parseMode:{html}';
}


//telegram messages sending
ts_SendTelegram($employeeid, $newTelegramText, $taskDataGeo);
Expand Down Expand Up @@ -1963,6 +1970,14 @@ function ts_ModifyTask($taskid, $startdate, $starttime, $address, $login, $phone
$newTelegramText .= $userCableSeal;
}
}

//appending task direct URL to task
$fullBillingUrl = $ubillingConfig->getAlterParam('FULL_BILLING_URL');
$appendTaskLinkFlag = $ubillingConfig->getAlterParam('TASKMAN_SEND_TASKURL');
if (!empty($fullBillingUrl) AND $appendTaskLinkFlag) {
$newTelegramText .= '<a href="' . $fullBillingUrl . '/?module=taskman&edittask=' . $taskid . '">🔍 ' . __('View task') . '</a> parseMode:{html}';
}

ts_SendTelegram($employeeid, $newTelegramText);
}

Expand Down
6 changes: 5 additions & 1 deletion config/alter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1244,4 +1244,8 @@ TASKMAN_WAREHOUSE_HLPR=0
;Is photostorage gallery enabled?
PHOTOSTORAGE_GALLERY=1
;Is warehouse items returns enabled?
WAREHOUSE_RETURNS_ENABLED=0
WAREHOUSE_RETURNS_ENABLED=0
;Specifies full billing URL for interraction with your employee. For example: http://yourisp.com/billing/ or https://billing.yourisp.com
FULL_BILLING_URL=""
;Appends direct URL of the task on telegram. Requires FULL_BILLING_URL non empty option.
TASKMAN_SEND_TASKURL=0
4 changes: 3 additions & 1 deletion content/updates/configs/1.2.1.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ TASKMAN_ADV_FILTERS_BRANCHES_ON=0
WAREHOUSE_TASKOUTEMPLOYEE=0
TASKMAN_WAREHOUSE_HLPR=0
PHOTOSTORAGE_GALLERY=1
WAREHOUSE_RETURNS_ENABLED=0
WAREHOUSE_RETURNS_ENABLED=0
FULL_BILLING_URL=""
TASKMAN_SEND_TASKURL=0

0 comments on commit cb19357

Please sign in to comment.