Skip to content

Commit

Permalink
Merge branch 'master' into apikeys2
Browse files Browse the repository at this point in the history
  • Loading branch information
interduo authored Jun 5, 2023
2 parents 551f4f1 + 102f107 commit 72f48e4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 14 deletions.
5 changes: 5 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,11 @@ version 28-git (????-??-??):
- enhancement: 'without start date' assignment filter added in customer search form [chilan]
- improvement: show customer id for addresses in 'merge' mode lms-teryt.php script [chilan]
- enhancement: added division property to network devices [chilan]
- improvement: show source name in imported operation list pending for confirmation [chilan]
- improvement/devel: 'get_customer_sms_options' plugin hook introduced which allows to collect
specific sms-like section configuration variable names [chilan]
- improvement: send document confirm notifications if document is created with 'closed'
status [chilan]
- enhancement: added support for user API keys [interduo]

version 27.0 (2021-08-20):
Expand Down
2 changes: 1 addition & 1 deletion lib/LMS.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3292,7 +3292,7 @@ public function SendSMS($number, $message, $messageid = null, $sms_options = nul

// message ID must be unique
if (!$messageid) {
$messageid = '0.' . time();
$messageid = '0.' . microtime(true);
}

$message = preg_replace("/\r/", "", $message);
Expand Down
7 changes: 7 additions & 0 deletions lib/LMSManagers/LMSCustomerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2717,6 +2717,8 @@ public function isTelecomServiceSuggested($customerid)

public function getCustomerSMSOptions()
{
global $LMS;

$options = array();

$variable_mapping = array(
Expand All @@ -2737,6 +2739,11 @@ public function getCustomerSMSOptions()
'message_template' => 'sms-customers.message_template',
);

$variable_mapping = $LMS->executeHook(
'get_customer_sms_options',
$variable_mapping
);

foreach ($variable_mapping as $option_name => $variable_name) {
if (is_array($variable_name)) {
$exists = false;
Expand Down
17 changes: 12 additions & 5 deletions modules/cashimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,18 @@

$divisions[0] = array('id' => 0, 'name' => '');

if ($importlist = $DB->GetAll('SELECT i.*, c.divisionid
FROM cashimport i
LEFT JOIN customerview c ON (i.customerid = c.id)
WHERE i.closed = 0 AND i.value > 0
ORDER BY i.id')) {
if ($importlist = $DB->GetAll(
'SELECT
i.*,
c.divisionid,
cs.name AS sourcename
FROM cashimport i
LEFT JOIN customerview c ON i.customerid = c.id
LEFT JOIN cashsources cs ON cs.id = i.sourceid
WHERE i.closed = 0
AND i.value > 0
ORDER BY i.id'
)) {
$listdata['total'] = count($importlist);

foreach ($importlist as $idx => $row) {
Expand Down
14 changes: 9 additions & 5 deletions modules/documentadd.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,16 @@
)
);
$document = $hook_data['document'];
}

if ($LMS->DocumentExists($docid) && !empty($document['confirmdate'])) {
$document['id'] = $docid;
$document['fullnumber'] = $fullnumber;
$LMS->NewDocumentCustomerNotifications($document);
if (isset($document['closed'])) {
$LMS->CommitDocuments(array($docid), false, false);
}

if (!empty($document['confirmdate'])) {
$document['id'] = $docid;
$document['fullnumber'] = $fullnumber;
$LMS->NewDocumentCustomerNotifications($document);
}
}

if (!isset($document['reuse'])) {
Expand Down
13 changes: 10 additions & 3 deletions templates/default/cash/cashimport.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ <H1>{$layout.pagetitle}</H1>
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 1%;">
<col style="width: 25%;">
<col style="width: 42%;">
<col style="width: 32%;">
Expand All @@ -45,6 +46,9 @@ <H1>{$layout.pagetitle}</H1>
<td>
{trans("ID:")}
</td>
<td>
{trans("Source")}
</td>
<td>
{trans("Date:")}
</td>
Expand All @@ -69,7 +73,7 @@ <H1>{$layout.pagetitle}</H1>
{foreach $divisions as $division}
{if $division.list}
<tr>
<td colspan="4" class="dark">
<td colspan="5" class="dark">
{icon name="division"}
<strong>{$division.name|escape}</strong>
</td>
Expand All @@ -82,6 +86,9 @@ <H1>{$layout.pagetitle}</H1>
<td>
{$item.id|string_format:"%04d"}
</td>
<td>
<strong>{$item.sourcename|escape}</strong>
</td>
<td class="nobr">
{$item.date|date_format:"Y-m-d"}
</td>
Expand Down Expand Up @@ -113,15 +120,15 @@ <H1>{$layout.pagetitle}</H1>
{/foreach}
{if !$listdata.total}
<tr>
<td class="empty-table" colspan="7">
<td class="empty-table" colspan="8">
{trans("No cash operations to import.")}
</td>
</tr>
{/if}
</tbody>
<tfoot>
<tr class="lms-ui-button-panel">
<td class="nobr" colspan="3">
<td class="nobr" colspan="4">
<label>
<input type="checkbox" name="allbox" class="lms-ui-multi-check-all" value="1" form="cashimport">
{trans("Check All")}
Expand Down

0 comments on commit 72f48e4

Please sign in to comment.