diff --git a/RELEASE b/RELEASE index 838983ad7..b7b75d0d2 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -1.5.1 rev 9268 +1.5.1 rev 9269 diff --git a/api/libs/api.pseudocrm.php b/api/libs/api.pseudocrm.php index 23dc2c684..013154612 100644 --- a/api/libs/api.pseudocrm.php +++ b/api/libs/api.pseudocrm.php @@ -1224,7 +1224,7 @@ public function renderLeadActivitiesList($leadId, $onlyLast = false) { $previousActivities = $this->getLeadActivities($leadId); if (!empty($previousActivities)) { if ($onlyLast) { - $previousActivities=array_slice($previousActivities, 0, 1, true); + $previousActivities = array_slice($previousActivities, 0, 1, true); } //performing stigma instances creation @@ -1298,6 +1298,62 @@ public function renderLeadTaskCreateForm($leadId) { return ($result); } + /** + * Returns sticky note creation form + * + * @return string + */ + protected function renderStickyCreateForm($textPreset) { + $inputs = wf_tag('label') . __('Text') . ': ' . wf_tag('br') . wf_tag('label', true); + $inputs .= wf_TextArea('newtext', '', $textPreset, true, '50x15'); + $inputs .= wf_CheckInput('newactive', __('Create note as active'), true, true); + $inputs .= wf_DatePickerPreset('newreminddate', ''); + $inputs .= wf_tag('label') . __('Remind only after this date') . wf_tag('label', true); + $inputs .= wf_tag('br'); + $inputs .= wf_TimePickerPreset('newremindtime', '', __('Remind time'), false); + $inputs .= wf_tag('br'); + $inputs .= wf_tag('br'); + $inputs .= wf_Submit(__('Create')); + + $result = wf_Form(StickyNotes::URL_ME, 'POST', $inputs, 'glamour'); + + return ($result); + } + + + /** + * Returns lead sticky note creation form control + * + * @param int $leadId + * + * @return string + */ + protected function renderLeadStickyControl($leadId) { + $result = ''; + $leadId = ubRouting::filters($leadId, 'int'); + if ($this->isLeadExists($leadId)) { + $leadData = $this->getLeadData($leadId); + $textPreset = ''; + $textPreset .= __('Lead') . ': ' . $leadData['address'] . PHP_EOL; + $textPreset .= __('Real Name') . ': ' . $leadData['realname'] . PHP_EOL; + if (!empty($leadData['mobile'])) { + $textPreset .= __('Mobile') . ': ' . $leadData['mobile'] . PHP_EOL; + } + if (!empty($leadData['phone'])) { + $textPreset .= __('Phone') . ': ' . $leadData['phone'] . PHP_EOL; + } + if (!empty($leadData['extmobile'])) { + $textPreset .= __('Additional mobile') . ': ' . $leadData['extmobile'] . PHP_EOL; + } + $textPreset .= '======' . PHP_EOL; + + + $stickyForm = $this->renderStickyCreateForm($textPreset); + $result .= wf_modalAuto(wf_img('skins/pushpin.png') . ' ' . __('Create new personal note'), __('Create new personal note'), $stickyForm, 'ubButton'); + } + return ($result); + } + /** * Searches lead Id by assigned login, returns 0 if not found. * @@ -1567,6 +1623,12 @@ public function renderPanel() { if (cfr(self::RIGHT_TASKS)) { $result .= $this->renderLeadTaskCreateForm($leadId); } + + if (cfr('STICKYNOTES')) { + if ($this->altCfg['STICKY_NOTES_ENABLED']) { + $result .= $this->renderLeadStickyControl($leadId); + } + } } if (ubRouting::checkGet(self::ROUTE_LEADS_LIST)) { diff --git a/config/optsextcfg b/config/optsextcfg index c002e24a3..f7292af0b 100755 --- a/config/optsextcfg +++ b/config/optsextcfg @@ -9,7 +9,6 @@ ftp gd hash iconv -imap json libxml mbstring