Skip to content

Commit d2a82fc

Browse files
committed
PseudoCRM: ability to create sticky note from lead profile implemented
1 parent 2ef7b12 commit d2a82fc

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed

RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.1 rev 9268
1+
1.5.1 rev 9269

api/libs/api.pseudocrm.php

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ public function renderLeadActivitiesList($leadId, $onlyLast = false) {
12241224
$previousActivities = $this->getLeadActivities($leadId);
12251225
if (!empty($previousActivities)) {
12261226
if ($onlyLast) {
1227-
$previousActivities=array_slice($previousActivities, 0, 1, true);
1227+
$previousActivities = array_slice($previousActivities, 0, 1, true);
12281228
}
12291229

12301230
//performing stigma instances creation
@@ -1298,6 +1298,62 @@ public function renderLeadTaskCreateForm($leadId) {
12981298
return ($result);
12991299
}
13001300

1301+
/**
1302+
* Returns sticky note creation form
1303+
*
1304+
* @return string
1305+
*/
1306+
protected function renderStickyCreateForm($textPreset) {
1307+
$inputs = wf_tag('label') . __('Text') . ': ' . wf_tag('br') . wf_tag('label', true);
1308+
$inputs .= wf_TextArea('newtext', '', $textPreset, true, '50x15');
1309+
$inputs .= wf_CheckInput('newactive', __('Create note as active'), true, true);
1310+
$inputs .= wf_DatePickerPreset('newreminddate', '');
1311+
$inputs .= wf_tag('label') . __('Remind only after this date') . wf_tag('label', true);
1312+
$inputs .= wf_tag('br');
1313+
$inputs .= wf_TimePickerPreset('newremindtime', '', __('Remind time'), false);
1314+
$inputs .= wf_tag('br');
1315+
$inputs .= wf_tag('br');
1316+
$inputs .= wf_Submit(__('Create'));
1317+
1318+
$result = wf_Form(StickyNotes::URL_ME, 'POST', $inputs, 'glamour');
1319+
1320+
return ($result);
1321+
}
1322+
1323+
1324+
/**
1325+
* Returns lead sticky note creation form control
1326+
*
1327+
* @param int $leadId
1328+
*
1329+
* @return string
1330+
*/
1331+
protected function renderLeadStickyControl($leadId) {
1332+
$result = '';
1333+
$leadId = ubRouting::filters($leadId, 'int');
1334+
if ($this->isLeadExists($leadId)) {
1335+
$leadData = $this->getLeadData($leadId);
1336+
$textPreset = '';
1337+
$textPreset .= __('Lead') . ': ' . $leadData['address'] . PHP_EOL;
1338+
$textPreset .= __('Real Name') . ': ' . $leadData['realname'] . PHP_EOL;
1339+
if (!empty($leadData['mobile'])) {
1340+
$textPreset .= __('Mobile') . ': ' . $leadData['mobile'] . PHP_EOL;
1341+
}
1342+
if (!empty($leadData['phone'])) {
1343+
$textPreset .= __('Phone') . ': ' . $leadData['phone'] . PHP_EOL;
1344+
}
1345+
if (!empty($leadData['extmobile'])) {
1346+
$textPreset .= __('Additional mobile') . ': ' . $leadData['extmobile'] . PHP_EOL;
1347+
}
1348+
$textPreset .= '======' . PHP_EOL;
1349+
1350+
1351+
$stickyForm = $this->renderStickyCreateForm($textPreset);
1352+
$result .= wf_modalAuto(wf_img('skins/pushpin.png') . ' ' . __('Create new personal note'), __('Create new personal note'), $stickyForm, 'ubButton');
1353+
}
1354+
return ($result);
1355+
}
1356+
13011357
/**
13021358
* Searches lead Id by assigned login, returns 0 if not found.
13031359
*
@@ -1567,6 +1623,12 @@ public function renderPanel() {
15671623
if (cfr(self::RIGHT_TASKS)) {
15681624
$result .= $this->renderLeadTaskCreateForm($leadId);
15691625
}
1626+
1627+
if (cfr('STICKYNOTES')) {
1628+
if ($this->altCfg['STICKY_NOTES_ENABLED']) {
1629+
$result .= $this->renderLeadStickyControl($leadId);
1630+
}
1631+
}
15701632
}
15711633

15721634
if (ubRouting::checkGet(self::ROUTE_LEADS_LIST)) {

config/optsextcfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ftp
99
gd
1010
hash
1111
iconv
12-
imap
1312
json
1413
libxml
1514
mbstring

0 commit comments

Comments
 (0)