@@ -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 )) {
0 commit comments