Tatsuki SUGIURA
sugi****@users*****
2006年 7月 12日 (水) 20:41:56 JST
Index: slashjp/plugins/ScheduleShifts/templates/data;shifts;default diff -u /dev/null slashjp/plugins/ScheduleShifts/templates/data;shifts;default:1.1 --- /dev/null Wed Jul 12 20:41:56 2006 +++ slashjp/plugins/ScheduleShifts/templates/data;shifts;default Wed Jul 12 20:41:56 2006 @@ -0,0 +1,41 @@ +__section__ +default +__description__ +Repository for random data elements. + +* value = the name of the data element to retrieve + +Each data element may have any number of other variables. +__title__ + +__page__ +shifts +__lang__ +en_US +__name__ +data +__template__ +[% SWITCH value %] + +[% CASE 'page_title' + +-%]Site Editor Schedules[%- + +CASE 'shift_chg_subj'; + + day = day.ucfirst; + shift = shift.ucfirst; + date = date.replace(' 00:00', ''); + IF type == 'default'; + detail="Default $day $shift"; + ELSE; + detail="$date $day $shift"; + END; +-%]Shift Change Notice -- [% detail %]: [% old_nickname %] -> [% new_nickname; + +END %] + +__seclev__ +10000 +__version__ +$Id: data;shifts;default,v 1.1 2006/07/12 11:41:56 sugi Exp $ Index: slashjp/plugins/ScheduleShifts/templates/scheduleForm;shifts;default diff -u /dev/null slashjp/plugins/ScheduleShifts/templates/scheduleForm;shifts;default:1.1 --- /dev/null Wed Jul 12 20:41:56 2006 +++ slashjp/plugins/ScheduleShifts/templates/scheduleForm;shifts;default Wed Jul 12 20:41:56 2006 @@ -0,0 +1,98 @@ +__section__ +default +__description__ +The only page that will be defined in this plugin, this form will allow you +to specify both the default shifts, and any shift changes that will need +to be made in the upcoming weeks (number of weeks on form determined by +<b>constants.sheduleshift_numweeks</b>. +__title__ +Scheduling Form (ScheduleShift) +__page__ +shifts +__lang__ +en_US +__name__ +scheduleForm +__template__ +[% key = "-1"; + author_list.$key = "-"; + + myodd = 'data_hl1'; + myeven = 'data_hl2'; + myweeks = ['Default']; + FOR w = weeks; + myweeks.push(w); + END; + +-%] + +<form action="[% env.script_name %]" method="post"> +<input type="hidden" name="op" value="save"> + +[% PROCESS titlebar width=> "100%", title => "$constants.sitename Shifts" %] + +<table width="100%" cellpadding="5" cellspacing="0"> + +<tr class="tb_col"> + <th> </th> +[%- FOR day = days_of_week -%] + <th>[% day.ucfirst %]</th> +[%- END -%] +</tr> + +[% FOR w = myweeks -%] +<tr class="[% IF loop.index mod 2; myodd; ELSE; myeven; END %]"> + <th class="tb_col">[% w %]</th> + [% FOR d = days_of_week -%] + <td[% IF w == myweeks.1 && curr_day == d %] bgcolor="[% user.colors.bg_3 %]"[% END %]>[% FOR s = shift_types; + key = "-2"; + + # XXX skip if already past date + def_sel = default_shifts.$d.$s || -1; + cur_sel = shifts.$w.$d.$s || def_sel; + + myauthors = {}; + IF w == myweeks.0; + mylabel = "${d}_${s}"; + + FOR author = author_list.keys; + myauthors.$author = author_list.$author; + END; + + ELSE; + mylabel = "S_${w}_${d}_$s"; + + FOR author = author_list.keys; + IF author == def_sel; + myauthors.$key = author_list.$def_sel; + IF cur_sel == def_sel; + cur_sel = key; + END; + ELSIF author == cur_sel && cur_sel != def_sel; + myauthors.$author = author_list.$author _ ' *'; + ELSE; + myauthors.$author = author_list.$author; + END; + END; + + END; + + Slash.createSelect( + mylabel, + myauthors, cur_sel, 1 + ); + + %]<br> + [%- END -%] + </td> + [%- END -%] +</tr> +[% END %] +</table> + +<input type="submit" value="Save Schedule Changes"> +</form> +__seclev__ +10000 +__version__ +$Id: scheduleForm;shifts;default,v 1.1 2006/07/12 11:41:56 sugi Exp $ Index: slashjp/plugins/ScheduleShifts/templates/shift_change;shifts;default diff -u /dev/null slashjp/plugins/ScheduleShifts/templates/shift_change;shifts;default:1.1 --- /dev/null Wed Jul 12 20:41:56 2006 +++ slashjp/plugins/ScheduleShifts/templates/shift_change;shifts;default Wed Jul 12 20:41:56 2006 @@ -0,0 +1,83 @@ +__skin__ +default +__description__ +Message that is sent to recipients of shift change notices. + + This data comes from ScheduleShifts: + + old = UID of previous assignment of shift + new = UID of new assignment of shift + default = UID of default assignment of shift + date = Date of new assignment, if not a default assignment. + day = Day of new assignment. + type = Schedule change type ('default' or 'shift'). + shift = Name of shift being changed + + Shift_Default = Constant for $old or $new that represents + "The default user" + Shift_Notset = Constant for $old or $new representing + that no assignment has been made + + Inherent data from Messages. This has been hard to determine + but as near as I can figure out, we have: + + mode = Slash.MSG_MODE_EMAIL or Slash.MSG_MODE_WEB + user = User the message is being sent to (?) + +__title__ +Useless title to template +__page__ +shifts +__lang__ +en_US +__name__ +shift_change +__template__ +[% + IF msg.mode == Slash.MSG_MODE_WEB; + # Set formatting codes for web. + bold='<b>'; unbold='</b>'; break='<br>'; + ELSE; + # Set formatting codes for email. + bold='*'; unbold='*'; break="\n"; + END; + + IF user.uid == old; + the_shift = "your $shift"; + ELSE; + IF old > 0; + the_shift = "${old_nickname}'s $shift"; + ELSE; + IF old == Shift_Notset; + the_shift = "the unassigned $shift"; + ELSE; + the_shift = "${old_nickname}'s usual $shift"; + END; + END; + END; + + IF user.uid == new; + new_assign = 'you have'; + ELSE; + new_assign = "${new_nickname} has"; + END; +-%] +[% bold %]NOTICE OF SHIFT CHANGE[% unbold; break; +break -%] +[% IF type == 'default' -%] +Please be aware that [% new_assign %] been assigned[% break; +bold; 'all of '; the_shift; unbold -%] shifts for [% day %].[% +break -%] +[% ELSE -%] +Please be aware that [% new_assign %] been assigned[% break; +bold; the_shift; unbold -%] shift on [% day.ucfirst %][% IF date %], [% +date.replace(' 00:00', ''); END %].[% break; +break -%] +[% END -%] +Make sure you update your calendars appropriately![% +break; +break; -%] +__seclev__ +10000 +__version__ +$Id: shift_change;shifts;default,v 1.1 2006/07/12 11:41:56 sugi Exp $