Multi-line simple view "Week" - Portal in a Portal?

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 40
Joined: Wed Oct 06, 2010 6:49 pm
PostPosted: Mon Jul 18, 2011 7:15 pm
I'm working on a mod to have multiple lines displayed in the simple view for the Week layout, but running into a few issues and looking for the best fix... I'd like to avoid having a portal inside a portal.

This is the unmodified simple week view were only one line is displayed:
Week one line.png
Week one line.png (14.15 KiB) Viewed 6149 times


This is the modified simple week view were multiple lines are displayed:
Week multi line.png
Week multi line.png (36.89 KiB) Viewed 6149 times


The issue becomes the dead space due to "line one" being used for the week/day number. Obviously I would not want to get rid of week/day numbers, but the way things look my solution would be to have a "one line" portal for the week/day number, then a separate multi line portal (with repeat) for the event data. Any other thoughts on how to do this?

I'd also want to lose the ... and have line breaks. I seem to remember those are in a script somewhere.
Which script do I need to dig into to have simple day show ... while simple week uses line breaks? (like in the non-simple view)

As always thanks for the support.
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Tue Jul 19, 2011 6:33 am
Hi Max,

You can specify the starting row of a portal, so you could actually have two portals here. One on top that's one row and one line for the day numbers, and then another two line portal right below it that starts on row 2.

DPmax wrote:I'd also want to lose the ... and have line breaks. I seem to remember those are in a script somewhere.
Which script do I need to dig into to have simple day show ... while simple week uses line breaks? (like in the non-simple view)


Right, that script is: Read iCal Event by Number ( Source ; Number ) where the summary is assigned.

hth,
Jason
Posts: 40
Joined: Wed Oct 06, 2010 6:49 pm
PostPosted: Tue Jul 19, 2011 11:07 am
Ahhh... but your way makes too much sense :) I got stuck in late night programer's tunnel vision.

From a script execution standpoint do you see any pitfalls with simply duplicating the existing portal on the simple-week tab and making layout modification as needed? (scripts for new events or changes to existing events, including the drag scripts)
I'm wondering about any possible scripts that act upon a "named" tab or portal or field.

Thanks
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Tue Jul 19, 2011 12:07 pm
Right, duplicate (copy and paste) the existing one with all it's fields and then modify. We are naming the Portals: Calendar Portal 2, Calendar Portal 3, etc. but scripts aren't dependent on specific portal names. Duplicating the portal will just maintain this convention (next one should be Calendar Portal 9). The main tab names: Day, Week etc. are important, as well as the ones that denote simple or regular view, so you want to keep those the same, but otherwise you should be good.
-Jason
Posts: 40
Joined: Wed Oct 06, 2010 6:49 pm
PostPosted: Tue Jul 19, 2011 3:15 pm
Hmm, everything is great but the separator, I'm only getting the first line of my data. Here's the change I made:
Let ( [

separator = ¶ ;

// --------------------- You shouldn't have to edit below this line -----------------------

start = Position ( $sc_Event ; "SUMMARY" ; 1 ; 1 ) ;
Line = GetValue ( $sc_Event ; ValueCount ( Left ( $sc_Event ; Start + 1 ) ) ) ;
notime = GetAsTime ( $$sc_DateTimeStart ) = 0 or PatternCount ( $$sc_Mode ; "Sched" ) = 0
] ;

// Need to escape returns and pipes in our array

Substitute ( Line ;
[ "\n" ; If ( notime ; separator ; "¶" ) ] ; // events with no time are shown with return separated summaries on one line
[ "\," ; "," ] ;
[ "|" ; "/" ] ;
[ "\:" ; ":" ] ;
[ "SUMMARY:" ; "" ]
)

)
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Wed Jul 20, 2011 10:48 am
Hi Max,

Right, you're trying to do this in Simple View, and I lost track of that. When in Simple View, we cut off the top line of the summary, and untangling this in the scripts would be very tricky. An easier approach would be to leave the "...s" in there and then substitute them out for carriage returns in the display calculation field in CalendarRows: CalendarContentReptCalc. Something like this:

Let ( [
$row = Extend ( RowNumber ) ;
$column = Get ( CalculationRepetitionNumber )
];
Substitute (
GetValue ( Substitute ( GetValue ( $$sc_ArrayContent ; $row ) ; "|" ; "¶" ) ; $column )
; [ "\n" ; "¶" ] ; [ "..." ; ¶ ]
)

)

Let me know if that gets you closer,
Jason
Posts: 40
Joined: Wed Oct 06, 2010 6:49 pm
PostPosted: Wed Jul 20, 2011 12:53 pm
Thanks Jason, WORKED GREAT!

Since the tabs are named (Day, Week...) do you see any conflicts if I work in an IF statement so Day can use ... and Week use ¶, or maybe a better approach would be to make an alt version of CalendarContentReptCalc just for the Day version?
However I may be able to skip this since the end users are really only planning to use the Simple Week and Schedule layouts.
SeedCode Staff
SeedCode Staff
Posts: 691
Joined: Mon Feb 28, 2011 2:47 pm
PostPosted: Wed Jul 20, 2011 1:00 pm
Cool! Either way. The If statement should work fine, and you can base it on the global variable $$sc_Mode, i.e. PatternCount ( $$sc_Mode ; "Day" )

Let me know how it goes,
-Jason

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 2 guests

(855) SEEDCODE
[email protected]
Follow us: