-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathJob Tracker - JOB.txt
executable file
·263 lines (158 loc) · 43.4 KB
/
Job Tracker - JOB.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
@@ DEPENDENCIES: Core
th u(NEWCOBJ,Job Tracker <JOB>,job,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
&CMD`+JOB`PENNMUSH [u(cobj,job)]=$^(?s)(?\:\+)?(job|jobs|myjobs|myjob)(?\:/(\w+)?)?(?\:/(\d+)?)?(?\: +(.*?))?(?\:=(.*))?$:@attach %!/CMD`+JOB`MAIN
@set [u(cobj,job)]/CMD`+JOB`PENNMUSH=regexp
&CMD`+JOB`RHOSTMUSH [u(cobj,job)]=$^(?s)(?\:\+)?(job|jobs|myjobs|myjob)(?\:/(\\w+)?)?(?\:/(\\d+)?)?(?\: +(.*?))?(?\:=(.*))?$:@attach %!/CMD`+JOB`MAIN
@set [u(cobj,job)]/CMD`+JOB`RHOSTMUSH=regexp
&CMD`+JOB`MAIN [u(cobj,job)]=@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%#,1;@attach %!/INIT;@select/inline u(valnum,%2)=1,{th u(setq,page,%2)},0,{@attach %!/INC`GETSWITCH=%2;th u(setq,page,u(strfirstof,%3,1))};th u(setq,mode,switch(%1,myjob*,MYJOBS,job*,JOBS));@attach %!/INC`CHECKPC=%:,1;@attach %!/INC`[u(strfirstof,%q<switch>,MAIN)]=trim(%4),trim(%5)
@set [u(cobj,job)]/CMD`+JOB`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&SYSTEM`NAME [u(cobj,job)]=JOBS
&SWITCHES`PLAYER [u(cobj,job)]=REPLY|OLD|APPROVE|DENY|CANCEL|REVIVE|COMMENT|DUE|CLAIM|UNCLAIM|SCAN|NEXT|PENDING|ADDHELPER|REMHELPER|BRIEF|SEARCH|OPTIONS[if(isdbref(u(cobj,roll)),|ROLL)]
&SWITCHES`ADMIN [u(cobj,job)]=NEWBUCKET|DELBUCKET|RENBUCKET|LOCK|UNLOCK|RAWLOCK|BUCKET|CONFIG|DESC|SET
&Q`SELECT`START_JOBS [u(cobj,job)]=SELECT bucket_id,bucket_name,bucket_post_lock,bucket_admin_lock FROM volv_bucket
&CONFIG`OPTIONS [u(cobj,job)]=DEFAULT_CATEGORY|OWNER_APPOINT
&CONFIG`DEFAULT_CATEGORY [u(cobj,job)]=What Category should be assumed for +request if none is specified?
&CONFIG`DEFAULT_CATEGORY`DEFAULT [u(cobj,job)]=
&CONFIG`DEFAULT_CATEGORY`VALID [u(cobj,job)]=WORD
&CONFIG`OWNER_APPOINT [u(cobj,job)]=Are Job owners allowed to appoint Helpers to their own jobs?
&CONFIG`OWNER_APPOINT`DEFAULT [u(cobj,job)]=0
&CONFIG`OWNER_APPOINT`VALID [u(cobj,job)]=BOOL
&INIT [u(cobj,job)]=th u(setr,isadmin,u(isadmin,%#));th u(setq,admbids,iter(if(%q<isadmin>,u(setr,start,u(mysql3,SELECT`START_JOBS)),u(filter,TESTLOCK,u(setr,start,u(mysql3,SELECT`START_JOBS)),u(rsep),u(rsep),%:,4)),first(%i0,u(fsep)),u(rsep),%b));th u(setq,postnames,iter(u(FILTER,TESTLOCK,%q<start>,u(rsep),u(rsep),%:,3),u(elements,%i0,2,u(fsep)),u(rsep),|))
&FIL`TESTLOCK [u(cobj,job)]=cor(u(isadmin,%1),u(lmax,iter(%2,testlock(u(elements,%0,%i0,u(fsep)),%1))))
&CMD`+REQUEST`PENNMUSH [u(cobj,job)]=$^(?s)\+request(?\:/(\S+))?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+REQUEST`MAIN
@set [u(cobj,job)]/CMD`+REQUEST`PENNMUSH=regexp
&CMD`+REQUEST`RHOSTMUSH [u(cobj,job)]=$^(?s)\+request(?\:/(\\S+))?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+REQUEST`MAIN
@set [u(cobj,job)]/CMD`+REQUEST`RHOSTMUSH=regexp
&CMD`+REQUEST`MAIN [u(cobj,job)]=@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%#,1;@attach %!/INIT;@attach %!/INC`PARTIAL=u(strfirstof,%1,u(conf,DEFAULT_CATEGORY)),%q<postnames>,|,Bucket,Bucket;@attach %!/INC`REQUEST=trim(%2),trim(%3),%q<Bucket>,%:
@set [u(cobj,job)]/CMD`+REQUEST`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&INC`VALID`REQUEST [u(cobj,job)]=@check strlen(u(setr,value,stripansi(trim(%0))))=@attach %!/INC`MSG=ERROR: Request subject empty!;@stop u(charsearch,%q<value>,u(badchars))=@attach %!/INC`MSG=ERROR: Title cannot include: [v(badchars)];
&INC`REQUEST [u(cobj,job)]=@select/inline nor(strlen(%0),strlen(%1))=1,{@attach %!/INC`MAIN},{th u(setq,subm,u(strfirstof,objid(%3),%:));@attach %!/INC`VALID`REQUEST=%0;@attach %!/INC`FINDBUCKET=%2;@check cor(%q<isadmin>,testlock(%q<b1postlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(%0)=@attach %!/INC`MSG=Initial message empty! What are you asking staff for?;@check u(setr,job_id,u(call`5,volp_job_new,0,%q<t1id>,%q<b1id>,%q<b1anonymous>,'[sqlescape(%q<value>)]','[sqlescape(%1)]'))=@attach %!/INC`MSG=ERROR: Job could not be created. reason: %q<job_id>;@attach %!/INC`LOADJOB=first(%q<job_id>);@attach %!/INC`MSGJOB=Submitted by [if(%q<banonymous>,Anonymous,%q<t1name>)].}
&INC`LOCKSTART [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=ERROR: Permission Denied. This command is Wizard-only.;@attach %!/INC`FINDBUCKET=before(%0,/);@check strlen(after(%0,/))=@attach %!/INC`MSG=ERROR: Choose a POST or ADMIN lock type.;@attach %!/INC`PARTIAL=after(%0,/),POST|ADMIN,|,lock;
&INC`RAWLOCK [u(cobj,job)]=@attach %!/INC`LOCK=%0,%1,1;
&INC`LOCK [u(cobj,job)]=@attach %!/INC`LOCKSTART;@select/inline cor(t(%2),not(isdbref(u(cobj,group))))=1,{@attach %!/INC`VALID`LOCK=%1},0,{@attach %!/INC`VALID`GROUPLOCK=%1,1};@check u(setr,lockres,u(call`3,volp_lock,0,%q<b1id>,'%q<lock>','[sqlescape(%q<value>)]'))=@attach %!/INC`MSG=ERROR: Could not set Lock. REASON: %q<lockres>;@attach %!/INC`MSG=Locked the Bucket to %q<value>! (MEANING: %q<valueformat>);@attach %!/INC`MSG`CHAN=%q<lock> Locked Bucket %q<b1name> to: %q<value> (MEANING: %q<valueformat>)
&INC`UNLOCK [u(cobj,job)]=@attach %!/INC`LOCK=%0,#TRUE,1
&INC`DESC [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=ERROR: Permission Denied. This command is Wizard-only.;@attach %!/INC`FINDBUCKET=%0;@check strlen(%1)=@attach %!/INC`MSG=ERROR: Description field empty.;@attach %!/INC`DOSQL=SET`DESCRIPTION,%1,%q<b1id>;@attach %!/INC`DOSQL=SET`DESCRIPTION_RENDER,u(render,%1),%q<b1id>;@attach %!/INC`MSG=Description for %q<bname> set!
&Q`SET`DESCRIPTION [u(cobj,job)]=UPDATE vol_bucket SET bucket_description=? WHERE bucket_id=?
&Q`SET`DESCRIPTION_RENDER [u(cobj,job)]=UPDATE vol_bucket SET bucket_description_render=? WHERE bucket_id=?
&INC`SET [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=ERROR: Permission Denied. This command is Wizard-only.;@attach %!/INC`FINDBUCKET=before(%0,/);@check strlen(after(%0,/))=@attach %!/INC`MSG=ERROR: Set Type field empty.;@attach %!/INC`PARTIAL=after(%0,/),DUE|ANONYMOUS|STATS,|,type,type;@attach %!/INC`SET`CHECK`%q<type>;@attach %!/INC`SET`SET`%q<type>;@attach %!/INC`MSG=You change Bucket %q<bname>'s %q<type> setting to: %q<valueformat>;@attach %!/INC`MSG`CHAN=Changed Bucket %q<b1name>'s %q<type> setting to: %q<valueformat>
&INC`SET`CHECK`DUE [u(cobj,job)]=@attach %!/INC`VALID`DURATION=%1;
&INC`SET`CHECK`ANONYMOUS [u(cobj,job)]=@attach %!/INC`VALID`INT=%1;@check match(0 1 2 3,%q<value>)=@attach %!/INC`MSG=ERROR: The Anonymous setting must be 0, 1, 2 or 3.;
&INC`SET`CHECK`STATS [u(cobj,job)]=@attach %!/INC`VALID`BOOL=%1;
&INC`SET`SET`DUE [u(cobj,job)]=@attach %!/INC`DOSQL=SET`DUE,%q<value>,%q<b1id>
&INC`SET`SET`ANONYMOUS [u(cobj,job)]=@attach %!/INC`DOSQL=SET`ANONYMOUS,%q<value>,%q<b1id>
&INC`SET`CHECK`STATS [u(cobj,job)]=@attach %!/INC`DOSQL=SET`STATS,%q<value>,%q<b1id>
&Q`SET`DUE [u(cobj,job)]=UPDATE vol_bucket SET bucket_due=? WHERE bucket_id=?
&Q`SET`ANONYMOUS [u(cobj,job)]=UPDATE vol_bucket SET bucket_is_anonymous=? WHERE bucket_id=?
&Q`SET`STATS [u(cobj,job)]=UPDATE vol_bucket SET bucket_stats=? WHERE bucket_id=?
&INC`MSGJOB [u(cobj,job)]=@attach %!/INC`MSG=u(pueblize,%q<bucketname> Job %q<jid> - '%q<jtitle>',+job %q<jid>): %0,u(setr,finallist,u(FUN`MSGLIST,%1));@attach %!/INC`MAILJOB`%va=%0,%q<jid>,%q<jtitle>,u(FUN`MAILLIST,%1),%2
&INC`AMSGJOB [u(cobj,job)]=@attach %!/INC`MSG=u(pueblize,%q<bucketname> Job %q<jid> - '%q<jtitle>',+job %q<jid>): %0,u(FUN`AMSGLIST,%1);@attach %!/INC`MAILJOB`%va=%0,%q<jid>,%q<jtitle>,u(FUN`AMAILLIST,%1),%2
&INC`MAILJOB`PENNMUSH [u(cobj,job)]=@select/inline words(u(setr,recip,u(filter,WANTSMAIL,%3)))=>0,{@mail %q<recip>=Job %1: [edit(%q<jtitle>,/,\\)]/%0[if(strlen(%4),%R%R%4)]}
&INC`MAILJOB`RHOSTMUSH [u(cobj,job)]=@select/inline words(u(setr,recip,u(filter,WANTSMAIL,%3)))=>0,{th u(setq,subj,Job %1: [edit(%q<jtitle>,/,\\)]);th u(setq,msg,%0[if(strlen(%4),%R%R%4)]);@dolist/inline %q<recip>={think mailsend(%d0,%q<subj>,%q<msg>,1,%#)}}
&FIL`WANTSMAIL [u(cobj,job)]=u(opother,%0,JOB,MAIL)
&INC`OPTIONS [u(cobj,job)]=@attach %!/INC`OPTION=%0,%1,JOB
&OPTION`OPTIONS [u(cobj,job)]=MAIL|PENDING|BRIEF
&OPTION`MAIL [u(cobj,job)]=Receive @mail from Jobs? (PennMUSH Only)
&OPTIOn`MAIL`DEFAULT [u(Cobj,job)]=1
&OPTION`MAIL`VALID [u(Cobj,job)]=BOOL
&OPTION`PENDING [u(cobj,job)]=Run +job/pending on login?
&OPTIOn`PENDING`DEFAULT [u(Cobj,job)]=0
&OPTION`PENDING`VALID [u(Cobj,job)]=BOOL
&OPTION`BRIEF [u(cobj,job)]=Run +job/brief on login?
&OPTIOn`BRIEF`DEFAULT [u(Cobj,job)]=0
&OPTION`BRIEF`VALID [u(Cobj,job)]=BOOL
&FUN`MSGLIST [u(cobj,job)]=setunion(setunion(setunion(%:,%q<jhelobjids> %q<jhanobjids> %q<jownobjids>),lockfilter(%q<badminlock>,u(lwhoid))),%0)
&FUN`AMSGLIST [u(cobj,job)]=setunion(setunion(%: %q<jhanobjids>,lockfilter(%q<badminlock>,u(lwhoid))),%0)
&FUN`MAILLIST [u(cobj,job)]=u(filter,ISOBJID,setunion(%: %q<jhelobjids> %q<jhanobjids> %q<jownobjids>,%0))
&FUN`AMAILLIST [u(cobj,job)]=u(filter,ISOBJID,setunion(%: %q<jhanobjids>,%0))
@@ %0 - category being checked. %1 - mode. %2 - checker.
&Q`GET`ANYOBJIDS [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE job_id=?
&Q`GET`MAILNORMAL [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE job_id=? AND jlink_type>0
&Q`GET`MAILADMIN [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE job_id=? AND jlink_type=2
&Q`GET`LINKCLAIMOBJIDS [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE job_id=? AND jlink_type>0
&INC`VALID`BUCKETNAME [u(cobj,job)]=@check strlen(u(setr,value,ucstr(trim(stripansi(%0)))))=@attach %!/INC`MSG=You must enter the new category name!;@stop cor(u(charsearch,%q<value>,u(badchars) /),gte(strlen(%q<value>),8),gte(words(%q<value>),2))=@attach %!/INC`MSG=ERROR: Bucket names must be 8 or fewer characters. They cannot contain: [v(badchars)] / or spaces.;@stop cand(u(mysql,FIND`EXACTBUCKET,%q<value>),not(eq(%q<found_id>,%1)))=@attach %!/INC`MSG=ERROR: Bucket name is already in use!
&INC`NEWBUCKET [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=Permission Denied: Wizard only.;@attach %!/INC`VALID`BUCKETNAME=%0;@check u(setr,bucket_id,u(call`1,volp_job_bucket,0,'[sqlescape(%q<value>)]'))=@attach %!/INC`MSG=ERROR: Bucket '%0' could not be created. Reason: %q<bucket_id>;th u(call`3,volp_lock,0,%q<bucket_id>,'POST','#TRUE');th u(call`3,volp_lock,0,%q<bucket_id>,'ADMIN','V`ADMIN:>0');@attach %!/INC`MSG=Bucket '%q<value>' created!;@attach %!/INC`MSG`CHAN={Bucket Created: %q<value>}
&INC`FINDBUCKET [u(cobj,job)]=@check strlen(%0)=@attach %!/INC`MSG=No Bucket Name entered!;@check cor(u(setr,bucket_id,u(mysql,FIND`EXACTBUCKET,%0)),u(setr,bucket_id,u(mysql,FIND`WILDBUCKET,%0)))=@attach %!/INC`MSG=ERROR: Bucket '%0' not found!;@attach %!/INC`LOADBUCKET=%q<bucket_id>,1;
&INC`LOADBUCKET [u(cobj,job)]=th u(setq,bdata,u(mysql3,LOAD`BUCKET,%0));th iter(id name postlock adminlock anonymous due,u(setq,b%1%i0,u(elements,%q<bdata>,inum(0),u(fsep))));
&Q`FIND`EXACTBUCKET [u(cobj,job)]=SELECT bucket_id FROM volv_bucket WHERE bucket_name=? LIMIT 1
&Q`FIND`WILDBUCKET [u(cobj,job)]=SELECT bucket_id FROM volv_bucket WHERE bucket_name LIKE '!%' ORDER BY bucket_name LIMIT 1
&Q`LOAD`BUCKET [u(cobj,job)]=SELECT bucket_id,bucket_name,bucket_post_lock,bucket_admin_lock,bucket_is_anonymous,bucket_due FROM volv_bucket WHERE bucket_id=?
&INC`RENBUCKET [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=Permission Denied: Wizard only.;@attach %!/INC`FINDBUCKET=%0;@attach %!/INC`VALID`BUCKETNAME=%1,%q<bid>;@attach %!/INC`DOSQL=RENAME`BUCKET,%q<value>,%q<bid>;@attach %!/INC`REPORT={[ansi(h,%n)] renamed Bucket '%q<bname>' to '%q<value>'!};
&Q`RENAME`BUCKET [u(cobj,job)]=UPDATE vol_entity SET entity_name=? WHERE entity_id=?
&INC`DELBUCKET [u(cobj,job)]=@check u(iswizard,%#)=@attach %!/INC`MSG=Permission Denied: Wizard only.;@attach %!/INC`FINDBUCKET=%0;@attach %!/INC`VERIFY={[ansi(hr,WARNING:)] This will delete Job Category '%q<catname>'. All child jobs will be gone forever. Are you sure you want to do this? Enter the same command again within ten seconds to verify!},DELETE %q<bid>;@attach %!/INC`MSG=Bucket '%0' Deleted!;@attach %!/INC`REPORT={[ansi(h,%n)] just deleted Bucket '%q<bname>'!};@attach %!/INC`DOSQL=DELETE`BUCKET,%q<bid>
&Q`DELETE`BUCKET [u(cobj,job)]=DELETE FROM vol_entity WHERE entity_id=?
&INC`MAIN [u(cobj,job)]=@select/inline 1=isint(%0),{@attach %!/INC`DISPLAYJOB=%0},t(strlen(%0)),{@attach %!/INC`DISPLAYBUCKET=%0,%1},{@select/inline %q<mode>=MYJOBS,{@attach %!/INC`MYJOBS`LIST},{@attach %!/INC`BUCKETS}}
&INC`BUCKETS [u(cobj,job)]=@pemit %#=u(HEADER,mudname() Jobs);@pemit %#=ansi(u(color,%#,COLUMN_NAMES),align(8 34 4 4 4 4 4 4 4,Name,Description,Pen,App,Dny,Cnc,Over,Due,Anon));@pemit %#=u(separator);@dolist/inline/delimit [u(rsep)] [u(mysql3,LIST`BUCKETS)]={@pemit %#=ansi(if(mod(inum(0),2),u(color,%#,ROW_A),u(color,%#,ROW_B)),u(FUN`BUCKETLINE,u(choosegame,%i0,%d0)));@pemit %#=};@pemit %#=u(FOOTER)
&FUN`BUCKETLINE [u(cobj,job)]=localize(align(8 34 4 4 4 4 4 4 4,u(pueblize,u(elements,%0,2,u(fsep)),+[lcstr(%q<mode>)] [u(elements,%0,2,u(fsep))]),u(elements,%0,3,u(fsep)),u(elements,u(setr,data,if(not(u(elements,%0,6,u(fsep))),iter(lnum(1,10),?,%b,u(fsep)),u(elements,%0,7 8 9 10 11,u(fsep),u(fsep)))),1,u(fsep)),u(elements,%q<data>,2,u(fsep)),u(elements,%q<data>,3,u(fsep)),u(elements,%q<data>,4,u(fsep)),u(elements,%q<data>,5,u(fsep)),u(strfirstof,u(etime,u(elements,%0,4,u(fsep))),0),u(elements,%0,5,u(fsep))))
&Q`LIST`BUCKETS [u(cobj,job)]=SELECT bucket_id,bucket_name,bucket_description,bucket_due,bucket_is_anonymous,bucket_stats,pending_count,approved_count,deny_count,cancel_count,overdue_count from volv_bucket_list
&INC`OLD [u(cobj,job)]=th u(setq,old,OLD);@attach %!/INC`MAIN
&INC`DISPLAYBUCKET [u(cobj,job)]=@attach %!/INC`FINDBUCKET=%0;@check match(%q<admbids>,%q<b1id>)=@attach %!/INC`MSG=ERROR: Permission denied.;th u(setq,total,u(mysql,GET`JOBLISTBUCKETCOUNT%q<old>,%q<b1id>));th u(setq,page,bound(%q<page>,1,u(setr,max,max(1,ceil(fdiv(%q<total>,30))))));@pemit %#=u(HEADER,mudname() - %q<b1name> Jobs);@pemit %#=align(2 >4 15 15 15 11 10,*,ID,Submitter,Title,Claimed,Due,Last);@pemit %#=u(SEPARATOR);@dolist/inline/delimit [u(rsep)] [revwords(u(mysql3,GET`JOBLISTBUCKET%q<old>,%q<t1id>,%q<b1id>,mul(30,sub(%q<page>,1))),u(rsep))]={@pemit %#=ansi(if(mod(inum(0),2),u(color,%#,ROW_A),u(color,%#,ROW_B)),u(FUN`LISTJOBSTAFF,u(choosegame,%i0,%d0)))};@pemit %#=u(FOOTER,if(gt(%q<page>,1),ansi(hg,u(pueblize,<,+job[if(strlen(%q<old>),/old)]/[sub(%q<page>,1)] %q<b1name>)),ansi(hx,<))%BPage %q<page> of [bound(%q<max>,1)]%B[if(lt(%q<page>,%q<max>),ansi(hg,u(pueblize,>,+job[if(strlen(%q<old>),/old)]/[add(%q<page>,1)] %q<b1name>)),ansi(hx,>))])
&Q`GET`JOBLISTBUCKET [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE j.bucket_id=? AND (j.job_status=0 OR j.job_is_recent) ORDER BY j.job_id DESC LIMIT 30 OFFSET ?
&Q`GET`JOBLISTBUCKETCOUNT [u(cobj,job)]=SELECT count(job_id) from volv_job WHERE bucket_id=? AND (job_status=0 OR job_is_recent)
&Q`GET`JOBLISTBUCKETOLD [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE j.bucket_id=? AND j.job_status>0 ORDER BY j.job_id DESC LIMIT 30 OFFSET ?
&Q`GET`JOBLISTBUCKETCOUNTOLD [u(cobj,job)]=SELECT count(job_id) from volv_job WHERE bucket_id=? AND job_status>0
&FUN`LISTJOBSTAFF [u(cobj,job)]=localize(align(2 >4 15 15 15 11 10,if(u(elements,%0,2,u(fsep)),ansi(hr,*),%b)[switch(u(elements,%0,1,u(fsep)),0,P,1,A,2,D,3,C,?)],u(pueblize,u(elements,%0,3,u(fsep)),+job [u(elements,%0,3,u(fsep))]),ansi(if(isobjid(u(setr,ownobj,u(elements,%0,5,u(fsep)))),,hx),if(u(elements,%0,4,u(fsep)),Anonymous,if(isobjid(%q<ownobj>),u(getmoniker,%q<ownobj>),u(elements,%0,6,u(fsep))))),u(elements,%0,7,u(fsep)),u(strfirstof,iter(u(elements,%0,8,u(fsep)),u(getmoniker,%i0),%b,[chr(44)]%b),---),ansi(if(u(elements,%0,10,u(fsep)),hr,),u(fancydate,u(elements,%0,9,u(fsep)))),u(fancydate,u(elements,%0,11,u(fsep)))))
&FUN`LIST`CLAIMERS [u(cobj,job)]=iter(u(mysql,GET`CLAIM,%0,2),u(getmoniker,%i0),%b,\,)
&Q`GET`CLAIM [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE job_id=? AND jlink_type=? ORDER BY character_name DESC
&INC`SCAN [u(cobj,job)]=@check words(%q<admbids>)=@attach %!/INC`MSG=Permission denied.;@dolist/inline/delimit [u(rsep)] [u(setr,maincount,u(mysql3,UNREAD`BUCKET_AGG,%q<t1id>,u(SQL`IN`NUMBER,%q<admbids>)))]={th u(setq,had,1);@pemit %#=u(HEADER,mudname() - New [u(elements,u(setr,bd,u(choosegame,%i0,%d0)),2,u(fsep))] Jobs);@pemit %#=align(2 >4 15 15 15 11 10,*,ID,Submitter,Title,Claimed,Due,Last);@pemit %#=u(SEPARATOR);@dolist/inline/delimit [u(rsep)] [u(mysql3,JOBS`FROMIDS,%q<t1id>,u(SQL`IN`NUMBER,u(elements,%q<bd>,3,u(fsep))))]={@pemit %#=ansi(if(mod(inum(0),2),u(color,%#,ROW_A),u(color,%#,ROW_B)),u(FUN`LISTJOBSTAFF,u(choosegame,%i0,%d0)))};@select/inline #@=words(%q<maincount>,u(rsep)),{@pemit %#=u(FOOTER)}};@select/inline not(%q<had>)=1,{@attach %!/INC`MSG=There are no new jobs in the system!}
&Q`UNREAD`BUCKET_AGG [u(cobj,job)]=SELECT j.bucket_id,j.bucket_name,GROUP_CONCAT(j.job_id ORDER BY j.job_id SEPARATOR ' ') AS unread_jobs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON j.job_id=jl.job_id AND jl.character_id=? WHERE (jl.jlink_date_check IS NULL OR jl.jlink_date_check<j.job_date_latest_activity) AND NOT (j.job_status>0 AND j.job_date_closed <= UTC_TIMESTAMP() - INTERVAL 14 DAY) AND j.bucket_id IN (!) GROUP BY j.bucket_id ORDER by j.bucket_name
&Q`JOBS`FROMIDS [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE j.job_id IN (!) ORDER BY j.job_id
&INC`NEXT [u(cobj,job)]=@check words(%q<admbids>)=@attach %!/INC`MSG=Permission denied.;@check u(setr,next,u(mysql,UNREAD`JOB,%q<t1id>,u(SQL`IN`NUMBER,%q<admbids>)))=@attach %!/INC`MSG=There are no unread jobs to see!;@attach %!/INC`DISPLAYJOB=%q<next>
&Q`UNREAD`JOB [u(cobj,job)]=SELECT j.job_id from volv_job as j LEFT JOIN vol_jlink AS jl ON j.job_id=jl.job_id AND jl.character_id=? WHERE j.bucket_id IN (!) AND (j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL) ORDER BY j.bucket_name ASC,j.job_id ASC limit 1
&INC`SEARCH [u(cobj,job)]=@check words(%q<admbids>)=@attach %!/INC`MSG=Permission denied.;@attach %!/INC`PARTIAL=%0,TEXT|PLAYER,|,choice;@select/inline %q<choice>=PLAYER,{@attach %!/INC`CHECKPC=%1,2},{@check strlen(%1)=@attach %!/INC`MSG=ERROR: No text entered to search for!};th u(setq,first,0);@pemit %#=u(header,Job Search Results for %q<choice>: [switch(%q<choice>,PLAYER,%q<t2name>,TEXT,left(%1,10))]);@pemit %#=align(2 >4 15 15 15 11 10,*,ID,Submitter,Title,Claimed,Due,Last);th u(setq,res,switch(%q<choice>,PLAYER,u(mysql3,SEARCH`PLAYER,%q<t1id>,%q<t2id>,u(SQL`IN`NUMBER,%q<admbids>)),TEXT,u(mysql3,SEARCH`TEXT,%q<t1id>,sqlescape(%1),sqlescape(%1),u(SQL`IN`NUMBER,%q<admbids>))));@dolist/inline/delimit [u(rsep)] %q<res>={th u(setq,data,u(choosegame,%i0,%d0));@select/inline strmatch(%q<last>,u(setr,last,u(elements,%q<data>,12,u(fsep))))=0,{@pemit %#=u(separator,%q<last>)};@pemit %#=ansi(if(mod(inum(0),2),u(color,%#,ROW_A),u(color,%#,ROW_B)),u(FUN`LISTJOBSTAFF,%q<data>))};@pemit %#=u(FOOTER)
&Q`SEARCH`PLAYER [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs,j.bucket_name FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? LEFT JOIN vol_jlink AS jl2 ON jl2.job_id=j.job_id AND jl2.character_id=? WHERE j.bucket_id IN (!) AND jl2.jlink_type>0 ORDER BY j.bucket_name,j.job_id
&Q`SEARCH`TEXT [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs,j.bucket_name FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE j.job_id IN (SELECT job_id FROM volv_jcomment WHERE jcomment_text LIKE '%!%') OR j.job_title LIKE '%!%' AND bucket_id IN (!) ORDER BY j.bucket_name,j.job_id
&INC`PENDING [u(cobj,job)]=@check words(%q<admbids>)=@attach %!/INC`MSG=Permission denied.;@check words(u(setr,pen,u(mysql3,PENDING`JOBS,u(SQL`IN`NUMBER,%q<admbids>))))=@attach %!/INC`MSG=There are no pending jobs.;@select/inline strlen(%0)=>0,{@select/inline strmatch(%0,-?*)=1,{@attach %!/INC`PARTIAL=after(%0,-),iter(%q<pen>,u(elements,%i0,2,u(fsep)),u(rsep),|),|,bucket;th u(setq,exclude,grab(%q<pen>,*[u(fsep)]%q<bucket>[u(fsep)]*,u(rsep)))},0,{@attach %!/INC`PARTIAL=%0,iter(%q<pen>,u(elements,%i0,2,u(fsep)),u(rsep),|),|,bucket;th u(setq,pen,grab(%q<pen>,*[u(fsep)]%q<bucket>[u(fsep)]*,u(rsep)))}};@dolist/inline/nobreak/delimit [u(rsep)] %q<pen>={@stop strmatch(u(choosegame,%i0,%d0),%q<exclude>);th u(setq,had,1);@pemit %#=u(HEADER,[u(elements,u(choosegame,%i0,%d0),2,u(fsep))] - [u(elements,u(choosegame,%i0,%d0),3,u(fsep))] New Jobs);@pemit %#=align(2 >4 15 15 15 11 10,*,ID,Submitter,Title,Claimed,Due,Last);@pemit %#=u(SEPARATOR);@dolist/inline/delimit [u(rsep)] [u(mysql3,PENDING`JOBSBUCKET,%q<t1id>,u(choosegame,%i0,%d0))]={@pemit %#=ansi(if(mod(inum(0),2),u(color,%#,ROW_A),u(color,%#,ROW_B)),u(FUN`LISTJOBSTAFF,u(choosegame,%i0,%d0)))}};@pemit %#=u(FOOTER)
&INC`BRIEF [u(cobj,job)]=@check words(%q<admbids>)=@attach %!/INC`MSG=Permission denied.;@check words(u(setr,pen,u(mysql3,PENDING`JOBS,u(SQL`IN`NUMBER,%q<admbids>))))=@attach %!/INC`MSG=There are no pending jobs.;@attach %!/INC`MSG=Pending Jobs by Category: [iter(%q<pen>,u(pueblize,name(u(elements,%i0,2,u(fsep))),+job [name(u(elements,%i0,2,u(fsep)))])%B\([u(elements,%i0,4,u(fsep))]\),u(rsep),\,%b)]
&Q`PENDING`JOBS [u(cobj,job)]=SELECT bucket_id,bucket_name,COUNT(job_id) FROM volv_job WHERE bucket_id IN (!) AND job_status=0 GROUP BY bucket_id ORDER BY bucket_name asc
&Q`PENDING`JOBSBUCKET [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE j.bucket_id=? AND j.job_status=0 ORDER BY j.job_id ASC LIMIT 20
&INC`MYJOBS`LIST [u(cobj,job)]=@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;th u(setq,total,u(mysql,COUNT`MYJOBS%q<old>,%q<t1id>));th u(setq,page,bound(%q<page>,1,u(setr,max,max(1,ceil(fdiv(%q<total>,30))))));@pemit %#=u(HEADER,mudname() - Your Jobs);@pemit %#=align(2 >4 8 15 15 10 18,*,ID,Bucket,Owner,Title,Upd,Claimed);@pemit %#=u(SEPARATOR);@dolist/inline/delimit [u(rsep)] [revwords(u(mysql3,LIST`MYJOBS%q<old>,%q<t1id>,mul(30,sub(%q<page>,1))),u(rsep))]={@pemit %#=u(FUN`MYLIST,u(choosegame,%i0,%d0))};@pemit %#=u(SUBHEADER,if(gt(%q<page>,1),ansi(hg,u(pueblize,<,+myjob[if(strlen(%q<old>),/old)]/[sub(%q<page>,1)])),ansi(hx,<))%BPage %q<page> of [bound(%q<max>,1)]%B[if(lt(%q<page>,%q<max>),ansi(hg,u(pueblize,>,+myjob[if(strlen(%q<old>),/old)]/[add(%q<page>,1)])),ansi(hx,>))])
&Q`COUNT`MYJOBS [u(cobj,job)]=SELECT count(j.job_id) FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE (jl.jlink_type>0 AND j.job_is_recent)
&Q`COUNT`MYJOBSOLD [u(cobj,job)]=SELECT count(j.job_id) FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE (jl.jlink_type>0 AND NOT j.job_is_recent)
&Q`LIST`MYJOBS [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.bucket_name,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_player_activity_secs,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE (jl.jlink_type>0 AND j.job_is_recent) ORDER BY j.job_id DESC LIMIT 30 OFFSET ?
&Q`LIST`MYJOBSOLD [u(cobj,job)]=SELECT j.job_status,j.job_date_latest_activity>jl.jlink_date_check OR jl.jlink_date_check IS NULL AS job_is_unread,j.bucket_name,j.job_id,j.job_is_anonymous,j.owner_objid,j.owner_name,j.job_title,j.handler_objids,j.job_date_due_secs,j.job_is_overdue,j.job_date_player_activity_secs,j.job_date_latest_activity_secs FROM volv_job AS j LEFT JOIN vol_jlink AS jl ON jl.job_id=j.job_id AND jl.character_id=? WHERE (jl.jlink_type>0 AND NOT j.job_is_recent) ORDER BY j.job_id DESC LIMIT 30 OFFSET ?
&FUN`MYLIST [u(cobj,job)]=align(2 >4 8 15 15 10 18,if(u(elements,%0,2,u(fsep)),ansi(hr,*),%b)[if(u(elements,%0,11,u(fsep)),ansi(hr,O),switch(u(elements,%0,1,u(fsep)),0,P,1,A,2,D,3,C,?))],u(pueblize,u(elements,%0,4,u(fsep)),+job [u(elements,%0,4,u(fsep))]),u(elements,%0,3,u(fsep)),switch(u(elements,%0,5,u(fsep))[isobjid(u(elements,%0,6,u(fsep)))],10,ansi(hx,Anonymous),11,Anonymous,00,ansi(hx,u(elements,%0,7,u(fsep))),u(getmoniker,u(elements,%0,6,u(fsep)))),u(elements,%0,8,u(fsep)),u(fancydate,u(elements,%0,10,u(fsep)),%#),iter(u(FILTEr,ISOBJID,u(elements,%0,9,u(fsep))),u(getmoniker,%i0),%b,\,))
&FUN`LIST`STATUS [u(cobj,job)]=switch(u(mysql,GET`JOBSTATUS,%0),0,P,1,A,2,D,3,C)
&FUN`LIST`STATUS2 [u(cobj,job)]=switch(u(mysql,GET`JOBSTATUS,%0),0,Pending,1,Approved,2,Denied,3,Canceled)
&JOBDATE [u(cobj,job)]=switch(%va,PennMUSH,timefmt($m/$d,%0,u(gettz,%#)),timefmt($M/$D,%0,u(gettz,%#)))
&JOBDATE2 [u(cobj,job)]=switch(%va,PennMUSH,timefmt($x,%0,u(gettz,%#)),timefmt($M/$D/$Y,%0,u(gettz,%#)))
&FUN`MASKNAME [u(cobj,job)]=switch(u(FUN`CONF,%0,ANONYMOUS),0,%n,1,if(strmatch(%:,u(mysql,GET`OWNEROBJID,%q<jid>)),Anonymous,%n),2,if(u(isadmin,%#),Anonymous,%n),3,Anonymous)
&INC`LOADJOB [u(cobj,job)]=@check isint(%0)=@attach %!/INC`MSG=ERROR: Must address a Job by its ID!;@check strlen(u(setr,data,u(mysql3,LOAD`JOB,%q<t1id>,%0)))=@attach %!/INC`MSG=ERROR: Job %0 not found.;th null(iter(bucketid bucketname bpostlock badminlock jid jtitle jcdate jddate joverdue jrecent jclosedate jpactive jaactive jlactive jstatus janon jownobjids jhelobjids jhanobjids jownname jownobjid jownid jltype jlid jlcheck,u(setq,%i0%1,u(elements,%q<data>,inum(0),u(fsep)))));
&Q`LOAD`JOB [u(cobj,job)]=SELECT j.bucket_id,j.bucket_name,j.bucket_post_lock,j.bucket_admin_lock,j.job_id,j.job_title,j.job_date_created_secs,j.job_date_due_secs,j.job_is_overdue,j.job_is_recent,j.job_date_closed_secs,j.job_date_player_activity_secs,j.job_date_admin_activity_secs,j.job_date_latest_activity_secs,j.job_status,j.job_is_anonymous,j.owner_objids,j.helper_objids,j.handler_objids,j.owner_name,j.owner_objid,j.owner_id,l.jlink_type,l.jlink_id,UNIX_TIMESTAMP(l.jlink_date_check) as jlink_date_check_secs FROM volv_job AS j LEFT JOIN vol_jlink AS l ON j.job_id=l.job_id AND l.character_id=? WHERE j.job_id=?
&INC`DISPLAYJOB [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check or(%q<jltype>,u(setr,catadmin,testlock(%q<badminlock>,%#)))=@attach %!/INC`MSG=ERROR: Permission Denied.;@pemit %#=u(HEADER,mudname() Jobs - Job %q<jid>);@pemit %#=align(36 36,ljust(rjust(ansi(h,Category:),10),10) %q<bucketname>,ljust(rjust(ansi(h,Due:),10),10) [u(strfirstof,u(JOBDATE2,%q<jddate>),---)]);@pemit %#=align(36 36,ljust(rjust(ansi(h,Title:),10),10) %q<jtitle>,ljust(rjust(ansi(h,Status:),10),10) [switch(%q<jstatus>,0,Pending,1,Approved,2,Denied,3,Canceled)]);@pemit %#=align(36 36,ljust(rjust(ansi(h,Handlers:),10),10) [u(FUN`LISTNAMES,%q<jhanobjids>)],ljust(rjust(ansi(h,Helpers:),10),10) [u(FUN`LISTNAMES,%q<jhelobjids>)]);@dolist/inline u(mysql,GET`COMMENT_IDS_%q<catadmin>,%q<jid>)={th u(setq,commdata,u(mysql3,LOAD`COMMENT,##));th null(iter(comid cdate ctext ctype cthing cobjid cname,u(setq,%i0,u(elements,%q<commdata>,inum(0),u(fsep)))));@pemit %#=u(separator);@pemit %#=[ansi(h,if(isobjid(%q<cobjid>),u(getmoniker,%q<cobjid>),ansi(hx,%q<cname>)) [u(FUN`CTYPE,%q<ctype>)] on [u(fancytime,%q<cdate>,%#)]:)][if(match(3 8 9 10 11 12,%q<ctype>),%b%q<ctext>,%R%q<ctext>)]};@pemit %#=u(FOOTER);@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>
&FUN`CTYPE [u(cobj,job)]=switch(%0,0,Opened,1,Replied,2,ansi(hr,STAFF COMMENTED),3,Moved,4,Approved,5,Denied,6,Canceled,7,Revived,8,Appointed Handler,9,Appointed Helper,10,Removed Handler,11,Removed Helper,12,Due Date Changed,???)
&FUN`LISTNAMES [u(cobj,job)]=iter(%0,u(getmoniker,%i0),%b,\,%b)
&FUN`LIST`HELPERS [u(cobj,job)]=iter(u(mysql,LIST`HELPERS,1,%0),u(getmoniker,%i0),%b,\,%b)
&FUN`LIST`HANDLERS [u(cobj,job)]=iter(u(mysql,LIST`HELPERS,2,%0),u(getmoniker,%i0),%b,\,%b)
&Q`LIST`HELPERS [u(cobj,job)]=SELECT character_objid FROM volv_jlink WHERE jlink_type=? AND job_id=? ORDER BY character_name desc
&Q`SET`CHECKDATE [u(cobj,job)]=INSERT INTO vol_jlink (job_id,character_id,jlink_date_check) VALUES (?,?,UTC_TIMESTAMP()) ON DUPLICATE KEY UPDATE jlink_date_check=VALUES(jlink_date_check)
&Q`GET`COMMENT_IDS_0 [u(cobj,job)]=SELECT jcomment_id FROM volv_jcomment WHERE job_id=? and jcomment_is_visible=1
&Q`GET`COMMENT_IDS_1 [u(cobj,job)]=SELECT jcomment_id FROM volv_jcomment WHERE job_id=?
&Q`LOAD`COMMENT [u(cobj,job)]=SELECT jcomment_id,jcomment_date_created_secs,jcomment_text,jcomment_type,commenter_id,commenter_objid,commenter_name FROM volv_jcomment WHERE jcomment_id=?
&Q`GET`LINKPRIV [u(cobj,job)]=SELECT jlink_type FROM volv_jlink WHERE job_id=? and character_id=? LIMIT 1
&Q`GET`LINK_ID [u(cobj,job)]=SELECT jlink_id FROM volv_jlink WHERE job_id=? AND character_id=? LIMIT 1
&INC`CLAIM [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check testlock(%q<badminlock>,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@stop neq(%q<jstatus>,0)=@attach %!/INC`MSG=The job is already finished.;@attach %!/INC`CHECKPC=u(strfirstof,%1,%#),2,1;@stop gt(u(setr,priv,u(mysql3,GET`LINKPRIV,%q<jid>,%q<t2id>)),1)=@attach %!/INC`MSG=ERROR: %q<t2name> is already [switch(%q<priv>,2,a Handler,3,the Owner)] for this Job.;@check first(u(setr,claim,u(call`3,volp_job_promote,0,%q<t2id>,%q<jid>,2)))=@attach %!/INC`MSG=ERROR: Claim couldn't be set. Reason: %q<claim>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<t2name>)]',8)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`AMSGJOB=New Handler Appointed: %q<t2name>,%q<t2objid>
&INC`UNCLAIM [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check testlock(%q<badminlock>,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@stop neq(%q<jstatus>,0)=@attach %!/INC`MSG=The job is already finished.;@attach %!/INC`CHECKPC=u(strfirstof,%1,%#),2,1;@stop neq(u(setr,priv,u(mysql3,GET`LINKPRIV,%q<jid>,%q<t2id>)),2)=@attach %!/INC`MSG=ERROR: %q<t2name> is not a Handler for this Job.;@check first(u(setr,claim,u(call`3,volp_job_promote,0,%q<t2id>,%q<jid>,0)))=@attach %!/INC`MSG=ERROR: Claim couldn't be set. Reason: %q<claim>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<t2name>)]',10)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`AMSGJOB=Handler Removed: %q<t2name>,%q<t2objid>
&INC`ADDHELPER [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check or(if(u(conf,OWNER_APPOINT),eq(%q<jltype>,3),0),testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@stop neq(%q<jstatus>,0)=@attach %!/INC`MSG=The job is already finished.;@attach %!/INC`CHECKPC=u(strfirstof,%1,%#),2,1;@stop gt(u(setr,priv,u(mysql3,GET`LINKPRIV,%q<jid>,%q<t2id>)),1)=@attach %!/INC`MSG=ERROR: %q<t2name> is already [switch(%q<priv>,2,a Handler,3,the Owner)] for this Job.;@check first(u(setr,claim,u(call`3,volp_job_promote,0,%q<t2id>,%q<jid>,1)))=@attach %!/INC`MSG=ERROR: Claim couldn't be set. Reason: %q<claim>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<t2name>)]',9)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`MSGJOB=New Helper Appointed: %q<t2name>,%q<t2objid>
&INC`REMHELPER [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check or(if(u(conf,OWNER_APPOINT),eq(%q<jltype>,3),0),testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@stop neq(%q<jstatus>,0)=@attach %!/INC`MSG=The job is already finished.;@attach %!/INC`CHECKPC=u(strfirstof,%1,%#),2,1;@stop neq(u(setr,priv,u(mysql3,GET`LINKPRIV,%q<jid>,%q<t2id>)),1)=@attach %!/INC`MSG=ERROR: %q<t2name> is not a Helper for this Job.;@check first(u(setr,claim,u(call`3,volp_job_promote,0,%q<t2id>,%q<jid>,0)))=@attach %!/INC`MSG=ERROR: Claim couldn't be set. Reason: %q<claim>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<t2name>)]',11)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`MSGJOB=Helper Removed: %q<t2name>,%q<t2objid>
&INC`BUCKET [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check u(isadmin,%#)=@attach %!/INC`MSG=Permission denied.;@attach %!/INC`FINDBUCKET=%1;@attach %!/INC`AMSGJOB=Changed Bucket to: %q<b1name>;@attach %!/INC`DOSQL=SET`JOBCAT,%q<b1id>,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;@attach %!/INC`UPDJOB=0,%q<jid>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<bucketname> -> %q<b1name>)]',3)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;
&Q`SET`JOBCAT [u(cobj,job)]=UPDATE vol_job SET bucket_id=? WHERE job_id=?
&INC`REPLY [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check or(%q<jltype>,testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@stop %q<jstatus>=@attach %!/INC`MSG=The job is already finished.;@check strlen(%1)=@attach %!/INC`MSG=What will you say?;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%1)]',1)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`MSGJOB=if(cand(eq(%q<t1id>,%q<jownid>),%q<anon>),Anonymous,%q<t1name>) sent a reply.,,%1
&INC`COMMENT [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check cor(eq(%q<jltype>,2),testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@stop %q<jstatus>=@attach %!/INC`MSG=The job is already finished.;@check strlen(%1)=@attach %!/INC`MSG=What will you say?;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%1)]',2)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`UPDJOB=1,%q<jid>;@attach %!/INC`AMSGJOB=%q<t1name> added a STAFF COMMENT.,,%1
&INC`UPDJOB [u(cobj,job)]=@attach %!/INC`DOSQL=SET`JOBACTIVITY%0,u(strfirstof,%1,%q<jid>)
&Q`SET`JOBACTIVITY0 [u(cobj,job)]=UPDATE vol_job SET job_date_player_activity=UTC_TIMESTAMP(),job_date_admin_activity=UTC_TIMESTAMP() WHERE job_id=?
&Q`SET`JOBACTIVITY1 [u(cobj,job)]=UPDATE vol_job SET job_date_admin_activity=UTC_TIMESTAMP() WHERE job_id=?
&INC`APPROVE [u(cobj,job)]=@attach %!/INC`FINISH;@attach %!/INC`DOFINISH=%0,%1,Approved,1
&INC`DENY [u(cobj,job)]=@attach %!/INC`FINISH;@attach %!/INC`DOFINISH=%0,%1,Denied,2
&INC`CANCEL [u(cobj,job)]=@attach %!/INC`FINISH;@attach %!/INC`DOFINISH=%0,%1,Canceled,3
&INC`REVIVE [u(cobj,job)]=@attach %!/INC`FINISH;@attach %!/INC`DOFINISH=%0,%1,Revived,0
&INC`FINISH [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check cor(eq(%q<jstatus>,2),testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(%1)=@attach %!/INC`MSG=What will you say?
&INC`DOFINISH [u(cobj,job)]=@stop cand(%q<jstatus>,%3)=@attach %!/INC`MSG=That job is already finished.;@select/inline %3=0,{@attach %!/INC`DOSQL=SET`REVIVED,%q<jid>},{@attach %!/INC`DOSQL=SET`FINISHED,%3,%q<jid>};@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%1)]',switch(%3,1,4,2,5,3,6,0,7))))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`MSGJOB=Has been marked %2,,%1
&Q`SET`FINISHED [u(cobj,job)]=UPDATE vol_job SET job_status=?,job_date_closed=UTC_TIMESTAMP(),job_date_player_activity=UTC_TIMESTAMP(),job_date_admin_activity=UTC_TIMESTAMP() WHERE job_id=?
&Q`SET`REVIVED [u(cobj,job)]=UPDATE vol_job SET job_status=0,job_date_closed=SET_NULL,job_date_player_activity=UTC_TIMESTAMP(),job_date_admin_activity=UTC_TIMESTAMP() WHERE job_id=?
&INC`DUE [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check testlock(%q<badminlock>,%#)=@attach %!/INC`MSG=ERROR: Permission Denied.;@attach %!/INC`VALID`FUTURE=%1;@attach %!/INC`DOSQL=SET`JOBDUE,%q<value>,%q<jid>;@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<t1id>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<valueformat>)]',12)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`MSGJOB=Rescheduled for %q<valueformat> by %q<t1name>!;
&Q`SET`JOBDUE [u(cobj,job)]=UPDATE vol_job SET job_date_due=FROM_UNIXTIME(?) WHERE job_id=?
&INC`ROLL [u(cobj,job)]=@attach %!/INC`LOADJOB=%0;@check cor(gte(%q<slink>,1),testlock(%q<badminlock>,%#))=@attach %!/INC`MSG=ERROR: Permission Denied.;@stop %q<jstatus>=@attach %!/INC`MSG=The job is already finished.;@check strlen(%1)=@attach %!/INC`MSG=What will you roll?;@switch/inline t(strlen(after(%1,|)))=1,{@check u(u(cobj,roll)/FUN`FLAGCHECK,after(%1,|))=@attach %!/INC`MSG=ERROR: [u(itemize,iter(%q<errcheck>,ansi(h,%i0),|,|),|,and,\,)]};@include u(cobj,roll)/INC`INIT=,;@check strlen(setr(inflate,u(u(cobj,roll)/FUN`NORMALIZE,setr(string,before(%1,|)))))=@attach %!/INC`MSG=ERROR: Could not format roll formula. Please contact a coder.;@check strlen(setr(findnames,u(u(cobj,roll)/FUN`FINDNAMES,%q<inflate>,%#)))=@attach %!/INC`MSG=ERROR: Could not perform name finding. Please contact a coder.;@check gt(setr(totaldice,ulocal(u(cobj,roll)/FUN`CALC,setr(calcdice,u(u(cobj,roll)/FUN`CALCDICE,%q<findnames>,%#)))),0)=@attach %!/INC`MSG=ERROR: You have no dice to roll! Check your spelling and ensure that penalties aren't reducing your roll to nothing.;th setq(resformat,u(u(cobj,roll)/FUN`RESFORMAT));@attach %!/INC`DOSQL=SET`CHECKDATE,%q<jid>,%q<pid>;th u(setq,link,u(mysql3,GET`LINK_ID,%q<jid>,%q<t1id>));@check first(u(setr,comment,u(call`4,volp_job_comment,0,%q<t1id>,%q<jid>,'[sqlescape(%q<resformat>)]',13)))=@attach %!/INC`MSG=ERROR: Comment couldn't be created. Reason: %q<comment>;@attach %!/INC`UPDJOB=0,%q<jid>;@attach %!/INC`MSGJOB=%q<jid>,%q<t1name> sent a Roll in for [u(pueblize,%q<catname> Job %q<jid>: '%q<jtitle>',+job %q<jid>)].,%q<catobj>;@attach %!/INC`MAILJOB=%q<jid>,%q<t1name> sent a Roll in for [u(pueblize,%q<catname> Job %q<jid>: '%q<jtitle>',+job %q<jid>)].%R%RRoll:%R%q<resformat>,%q<catobj>;
&HLP`+JOB [u(cobj,job)]=+job is used to create 'trouble tickets,' requests to the Admin.%R[ansi(hc,Aliases:)] request%R%R[ansi(hc,Creating Jobs)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+request)] - Show all Job categories.%R[ansi(h,+request <title>=<text>)] - creates a new UNCATEGORIZED job.%R[ansi(h,+request/<category> <title>=<text>)] - Creates a new job in a specific category)]%R%R[ansi(hc,Tracking Jobs)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+myjobs)] - Display all pending jobs you've submitted or have been appointed to handle.%R[ansi(h,+myjobs/old)] - As above\, but shows only jobs that are finished.%R[ansi(h,+myjob <id>)] - Shows details about a job.%R[ansi(h,+myjob/reply <id>=<text>)] - Add a new message to your job.%R%RFor all listings\, use an extra switch /<page> to show pages. For instance\, +myjobs/old/4 to show page 4. +myjobs/4 also works.)]%R%R[ansi(hc,Handling Jobs)]%RThe following commands are for staff and priveleged players.%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+jobs)] - List all job categories and stats related to them.%R[ansi(h,+jobs <category>)] - List all pending jobs in a category. Use /<page> to show pages\, like +jobs/2 <category> for the second page.%R[ansi(h,+jobs/old <category>)] - Show all finished jobs in a category.%R\(use an extra switch /<page> to show different pages\, such as +jobs/old/3 xp to view the third page.\)%R[ansi(h,+job <id>)] - Display a job's details.%R[ansi(h,+job/reply <id>=<text>)] - Reply to a job.%R[ansi(h,+job/comment <id>=<text>)] - Add notes to a job that only category handlers and staff can see.%R[ansi(h,+job/attn <id>)] - Change whether a job is marked as waiting for staff or the player.%R[ansi(h,+job/claim <id>)] - Claim a job. Many can claim the same job. Use [ansi(h,+job/claim <id>=<target>)] to add someone else.%R[ansi(h,+job/unclaim <id>)] - As /claim. Removes a handler.%R[ansi(h,+job/addhelper <id>=<player>)] - Designate player as Helper. They can view and /reply to jobs.%R[ansi(h,+job/remhelper <id>=<player>)] - Remove 'Helper' player.%R[ansi(h,+job/approve <id>=<text>)] - Closes a job and sends an approval message.%R[ansi(h,+job/deny <id>=<text>)] - As /approve.%R[ansi(h,+job/cancel <id>=<text>)] - As /approve.%R[ansi(h,+job/revive <id>=<text>)] - Restores a closed job to pending status.%R[ansi(h,+job/due <id>=<newdate>)] - Sets a new due date for a job. Can be a +1d or similar \(adds to current due date using value from a [ansi(h,stringsecs\(\))] function - check the helpfile for stringsecs\) or a specific date using [ansi(h,convtime\(\))]. As an example: +job/due x=+5d or +job/due x=[u(fancytime,secs(),%#)]%R[ansi(h,+job/scan)] - List all unread/changed or pending jobs.%R[ansi(h,+job/next)] - Like +bbnext\, read the next unread job you can see.%R[ansi(h,+job/pending)] - List all pending jobs in categories you manage.)]
+help/add Communications/+job=[u(cobj,job)]/HLP`+JOB
&SHLP`+JOB [u(cobj,job)]=[ansi(hc,Staff Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+job/bucket <id>=<category>)] - Moves a job to a new Bucket.)]%R%R[ansi(hc,Wizard Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+job/newbucket <name>)] - Creates a new category.%R[ansi(h,+job/delbucket <name>)] - Deletes a Job Bucket.%R[ansi(h,+job/renbucket <name>=<newname>)] - Renames a category.%R[ansi(h,+job/desc <name>=<description>)] - Set a category's description in +job%R[ansi(h,+job/lock <name>/<lock>=<lockstring>)] - Lock a category. <lock> can be ADMIN or POST for who can administrate a category and who can +request to it.%R[ansi(h,+job/rawlock <name>/<lock>=<lockstring>)] - Use hardcoded @lock system format locks.%R[ansi(h,+job/unlock <category>/<lock>)] - As above. Unlocks.%R[ansi(h,+job/config <category>/<option>=<value>)] - Sets a category's config. <option> can be Anon or Due.%R[ansi(h,DUE)] - Set to a value acceptable by stringsecs such as 5d or 50m. This is added to submit date to create the due date.%R[ansi(h,ANON)] - Modes 0-3. Mode 0 is fully transparent. Mode 1 hides submitter from staff. Mode 2 hides staff from submitter. Mode 3 is 1+2 combined.)]
+shelp/add Communications/+job=[u(cobj,job)]/SHLP`+JOB