-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.php
502 lines (470 loc) · 24.8 KB
/
item.php
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<?php
//INCLUDES
include_once('header.php');
$values = array();
$values['itemId']= (isset($_GET['itemId']))?(int) $_GET['itemId']:0;
$values['parentId']=array();
//SQL CODE
if ($values['itemId']) { // editing an item
$where='edit';
$result = query("selectitem",$config,$values,$sort);
if ($result) {
$values = $result[0];
//Test to see if nextaction
$result = query("testnextaction",$config,$values,$sort);
$nextaction= ($result && $result[0]['nextaction']==$values['itemId']);
$parents = query("lookupparent",$config,$values);
// if any are somedays, turn type 'p' into type 's'
} else {
echo "<p class='error'>Failed to retrieve item {$values['itemId']}</p>";
return;
}
} else { // creating an item
$where='create';
//set defaults
$nextaction=false;
$values['title']='';
$values['description']='';
$values['premiseA']='';
$values['premiseB']='';
$values['conclusion']='';
$values['behaviour']='';
$values['standard']='';
$values['conditions']='';
$values['hyperlink']='';
$values['metaphor']='';
$values['deadline']=null;
$values['dateCompleted']=null;
$values['repeat']=null;
$values['suppressUntil']=null;
$values['type']=$_GET['type'];
$values['isSomeday']=(isset($_GET['someday']) && $_GET['someday']=='true')?'y':'n';
$nextaction=isset($_GET['nextonly']) && ($_GET['nextonly']=='true' || $_GET['nextonly']==='y');
foreach ( array('category','context','timeframe') as $cat)
$values[$cat.'Id']= (isset($_GET[$cat.'Id']))?(int) $_GET[$cat.'Id']:0;
if ($values['type']==='s') {
$values['isSomeday']='y';
$values['type']='p';
} elseif ($values['type']==='n') {
$nextaction=true;
$values['type']='a';
} elseif ($values['type']==='a') {
$nextaction=true;
}
}
$show=getShow($where,$values['type']);
if (!$values['itemId']) {
if ($show['suppress'] && isset($_GET['suppress']) && ($_GET['suppress']=='true' || $_GET['suppress']==='y')) {
$values['suppress']='y';
$values['suppressUntil']=$_GET['suppressUntil'];
} else $values['suppress']='n';
if ($show['deadline'] && !empty($_GET['deadline']))$values['deadline']=$_GET['deadline'];
$parents=array();
if ($show['ptitle'] && !empty($_GET['parentId'])) {
$values['parentId']=explode(',',$_GET['parentId']);
foreach ($values['parentId'] as $parent) {
$result=query("selectitemshort",$config,array('itemId'=>$parent),$sort);
if ($result) {
$newparent=array(
'parentId'=>$result[0]['itemId']
,'ptitle'=>$result[0]['title']
,'isSomeday'=>$result[0]['isSomeday']
,'ptype'=>$result[0]['type']);
$parents[]=$newparent;
}
}
}
}
if (is_array($parents) && count($parents))
foreach ($parents as $row)
$values['parentId'][]=$row['parentId'];
if ($values['isSomeday']==="y")
$typename="Someday/Maybe";
else
$typename=getTypes($values['type']);
if ($nextaction) $typename="Next ".$typename;
//create filters for selectboxes
$values['timefilterquery'] = ($config['useTypesForTimeContexts'] && $values['type']!=='i')?" WHERE ".sqlparts("timetype",$config,$values):'';
//create item, timecontext, and spacecontext selectboxes
$cashtml = categoryselectbox($config,$values,$sort);
$cshtml = contextselectbox($config,$values,$sort);
$tshtml = timecontextselectbox($config,$values,$sort);
$oldtype=$values['type'];
//PAGE DISPLAY CODE
$title=(($values['itemId']>0)?'Edit ':'New ').$typename;
$hiddenvars=array(
'referrer'=>(isset($_GET['referrer']))?$_GET['referrer']:''
,'type' =>$values['type']
,'itemId' =>$values['itemId']
);
if ($values['itemId']) {
$hiddenvars['action']='fullUpdate';
} else
$hiddenvars['action']='create';
$ptypes=getParentType($values['type']);
if ($_SESSION['useLiveEnhancements']) {
$alltypes=getTypes();
$allowedSearchTypes=array();
if (count($ptypes)>1) $allowedSearchTypes[0]='All';
foreach($ptypes as $ptype)
$allowedSearchTypes[$ptype]=$alltypes[$ptype].'s';
$values['ptypefilterquery']=" AND ia.`type` IN ('".implode("','",$ptypes)."') ";
$potentialparents = query("parentselectbox",$config,$values,$sort);
if (!$potentialparents) $potentialparents=array();
} elseif (count($ptypes))
$values['ptypefilterquery']=" AND ia.`type`='{$ptypes[0]}' ";
if (count($ptypes)) $values['ptype']=$ptypes[0];
require_once("headerHtml.inc.php");
?><h2><?php
if ($values['itemId'])
echo "\n<a href='itemReport.php?itemId={$values['itemId']}'>"
,"<img src='themes/{$config['theme']}/report.gif' class='noprint' "
,"alt='Report' title='View Report' /></a>\n";
echo $title;
?><?php
if (!empty($_GET['createnote'])) { ?>
<p class='warning'>Notes have been superseded by tickler actions. These actions get
suppressed until a specified number of days before their deadlines</p>
<?php }
echo ' [ <a href="itemReport.php?itemId=' . $values['itemId'] . '">Report</a> ]';
if ($_GET['convert'] == true) {
$canchangetypesafely=array('a','w','r','o','g','v','p');
$other = " unlink qualities and/or children first?";
} elseif (in_array($values['type'], array('a','w','r'))) {
$canchangetypesafely=array('a','w','r');
$other = '[ <a href="' . $_SERVER['REQUEST_URI'] . '&convert=true">Other</a> ]';
} else {
echo ' [ <a href="' . $_SERVER['REQUEST_URI'] . '&convert=true">Convert</a> ]';
$canchangetypesafely=array();
}
$sep='';
if ((in_array($values['type'],$canchangetypesafely) || $values['type'] == 'i') && $values['itemId']) {
echo " Convert to [ ";
foreach ($canchangetypesafely as $totype) {
if ($totype!==$values['type']) {
echo "$sep <a href='processItems.php?action=changeType&itemId="
,$values['itemId'],"&safe=1&type=$totype&oldType=",$values['type'],"&isSomeday="
,$values['isSomeday'];
if (!empty($referrer)) echo "&referrer=$referrer";
echo "'>",getTypes($totype),"</a>\n";
$sep=' ] [ ';
}
}
echo " ] " . $other;
}
/*
if ($show['type']) {
echo $sep; ?>
<a href='assignType.php?itemId=<?php echo $values['itemId']; ?>'>Convert to another type</a>
(Warning, changing to another type will sever all relationships to its parent and child items)
<?php
$sep=' , ';
}
if ($sep!=='<p>') echo "</p>\n";
*/
echo "</h2>\n";
?>
<form action="processItems.php" method="post" onsubmit="return validate(this);"><div class='form'>
<div class='formrow'><span class="error" id='errorMessage'></span></div>
<?php
if ($show['ptitle']) { ?>
<div class='formrow'>
<label for='parenttable' class='left first'>Parent(s):</label>
<?php
// note this js enhancement could integrate live ajax updates but the effort isn't worth it for something i rarely use
if ($_SESSION['useLiveEnhancements']) {
include_once('liveParents.inc.php');
} else { ?>
<select name="parentId[]" id='parenttable' multiple="multiple" size="6">
<?php echo parentselectbox($config,$values,$sort); ?>
</select>
<?php } ?>
</div>
<?php } elseif (is_array($parents))
foreach ($values['parentId'] as $parent)
echo hidePostVar('parentId[]',$parent);
?><div class='formrow'>
<?php if ($show['category']) { ?>
<label for='category' class='left first'>Category:</label>
<select name='categoryId' id='category' <?php
if ($values['itemId']) echo ajaxUpd('itemCategory', $values['itemId']);
?>>
<?php echo $cashtml; ?>
</select>
<?php } else $hiddenvars['categoryId']=$values['categoryId'];
if ($show['context']) { ?>
<label for='context' class=''>Context:</label>
<select name='contextId' id='context' <?php
if ($values['itemId']) echo ajaxUpd('itemContext', $values['itemId']);
?>>
<?php echo $cshtml; ?>
</select>
<?php } else $hiddenvars['contextId']=$values['contextId'];
if ($show['timeframe'] && $values['type'] != 'p') { ?>
<label for='timeframe' class=''>Time:</label>
<select name='timeframeId' id='timeframe' <?php
if ($values['itemId']) echo ajaxUpd('itemTime', $values['itemId']);
?>>
<?php echo $tshtml; ?>
</select>
<?php } else $hiddenvars['timeframeId']=$values['timeframeId']; ?>
<?php if ($show['NA']) { ?>
<label for='nextAction' class=''>Next Action:</label><input type="checkbox" name="nextAction" id="nextAction" value="y" <?php
if ($nextaction) echo " checked='checked' class='checked' ";
else echo " class='unchecked' ";
if ($values['itemId']) echo ajaxUpd('itemNA', $values['itemId']);
?> />
<?php } else $hiddenvars['nextAction']=($nextaction)?'y':''; ?>
</div>
<?php
if($show['title']) { ?>
<div class='formrow'>
<label for='title' class='left first'>Title:</label>
<input class="JKPadding" type="text" name="title" id="title" value="<?php echo makeclean($values['title']); ?>"
<?php # item being edited (has itemId) not created so allow ajax save
if ($values['itemId']) echo ajaxUpd('itemTitle', $values['itemId']);
?> />
</div>
<?php } else $hiddenvars['title']=$values['title'];
if ($show['description']) { ?>
<div class='formrow'>
<label for='description' class='left first'>Description:<br>Why?</label>
<textarea rows='10' cols='50' name='description' id='description' class='JKPadding'
<?php # item being edited (has itemId) not created so allow ajax save
if ($values['itemId']) echo ajaxUpd('itemDescription', $values['itemId']);
?>><?php echo makeclean($values['description']); ?></textarea>
</div>
<?php } else $hiddenvars['description']=$values['description'];
if ($show['conclusion'] && preg_match('/[mvogp]/', $values['type']) || !empty($values['premiseA']) || !empty($values['premiseB']) || !empty($values['conclusion']) ) { ?> <!-- 'm', 'v', 'o', 'g', 'p', 'a', 'r', 'w', 'i' -->
<div class='formrow'>
<label for='premiseA' class='left first'>Premise A:</label>
<input class="JKPadding" type="text" name="premiseA" id="conclusion" value="<?php echo makeclean($values['premiseA']); ?>" />
</div>
<div class='formrow'>
<label for='premiseB' class='left first'>Premise B:</label>
<input class="JKPadding" type="text" name="premiseB" id="conclusion" value="<?php echo makeclean($values['premiseB']); ?>" />
</div>
<div class='formrow'>
<label for='conclusion' class='left first'>Conclusion:</label>
<input class="JKPadding" type="text" name="conclusion" id="conclusion" value="<?php echo makeclean($values['conclusion']); ?>" />
</div>
<?php
} // else $hiddenvars['behaviour']=$values['behaviour'];
if ($show['behaviour'] && preg_match('/[mvogp]/', $values['type']) || !empty($values['behaviour']) || !empty($values['standard']) || !empty($values['conditions']) ) { ?> <!-- 'm', 'v', 'o', 'g', 'p', 'a', 'r', 'w', 'i' -->
<div class='formrow'>
<label for='outcome' class='left first'>Behaviour:</label>
<input class="JKPadding" type="text" name="behaviour" id="outcome" value="<?php echo makeclean($values['behaviour']); ?>" />
</div>
<div class='formrow'>
<label for='standards' class='left first'>Standards:</label>
<input class="JKPadding" type="text" name="standard" id="outcome" value="<?php echo makeclean($values['standard']); ?>" />
</div>
<div class='formrow'>
<label for='conditions' class='left first'>Conditions:</label>
<input class="JKPadding" type="text" name="conditions" id="outcome" value="<?php echo makeclean($values['conditions']); ?>" />
</div>
<?php
} else $hiddenvars['behaviour']=$values['behaviour'];
if ($show['metaphor']) { ?> <!-- 'm', 'v', 'o', 'g', 'p' -->
<div class='formrow'>
<label for='metaphor' class='left first'>Metaphor:</label>
<input class="JKPadding" type="text" name='metaphor' id='metaphor' value='<?php echo makeclean($values["metaphor"]); ?>' />
</div>
<?php
} else $hiddenvars['metaphor']=$values['metaphor'];
?>
<div class='formrow'>
<label for='hyperlink' class='left first'>Hyperlink:
<?php
if ($values['hyperlink']) {
echo "<br>[ " . faLink($values['hyperlink']) . " ]";
}
?>
</label>
<input class="JKPadding" type="text" name="hyperlink" id="hyperlink" value="<?php
echo makeclean($values['hyperlink']) . '"';
if ($values['itemId']) echo ajaxUpd('itemLink', $values['itemId']);
?> />
</div>
<div class='formrow'>
<?php if ($show['deadline']) { ?>
<label for='deadline' class='left first'>Due date:</label>
<input type='text' size='10' name='deadline' id='deadline' class='hasdate' value='<?php echo $values['deadline']; ?>' <?php
if ($values['itemId']) echo ajaxUpd('itemDeadline', $values['itemId']);
?>/>
<button type='reset' id='deadline_trigger'>...</button>
<script type='text/javascript'>
Calendar.setup({
firstDay : <?php echo (int) $config['firstDayOfWeek']; ?>,
inputField : 'deadline', // id of the input field
ifFormat : '%Y-%m-%d', // format of the input field
showsTime : false, // will display a time selector
button : 'deadline_trigger', // trigger for the calendar (button ID)
singleClick : true, // single-click mode
step : 1 // show all years in drop-down boxes (instead of every other year as default)
});
</script>
<?php } else $hiddenvars['deadline']=$values['deadline'];
if ($show['dateCompleted']) { ?>
<label for='dateCompleted' class=''>Completed:</label><input type='text' size='10' class='hasdate' name='dateCompleted' id='dateCompleted' value='<?php echo $values['dateCompleted'] ?>' <?php
if ($values['itemId'] && strlen($values['dateCompleted']) < 1) echo ajaxUpd('itemCompletedNow', $values['itemId']);
if ($values['itemId'] && strlen($values['dateCompleted']) > 1) echo ajaxUpd('itemCompletedEdit', $values['itemId']);
?>/>
<button type='reset' id='dateCompleted_trigger' <?php if (strlen($values['dateCompleted']) < 1) echo 'hidden'; ?>>...</button>
<script type='text/javascript'>
Calendar.setup({
firstDay : <?php echo (int) $config['firstDayOfWeek']; ?>,
inputField : 'dateCompleted', // id of the input field
ifFormat : '%Y-%m-%d', // format of the input field
showsTime : false, // will display a time selector
button : 'dateCompleted_trigger', // trigger for the calendar (button ID)
singleClick : true, // single-click mode
step : 1 // show all years in drop-down boxes (instead of every other year as default)
});
</script>
<button type='button' id='dateCompleted_today' <?php if (strlen($values['dateCompleted']) > 1) echo 'hidden'; ?> onclick="javascript:completeToday('dateCompleted');focusOnForm('dateCompleted');">Today</button>
<?php } else $hiddenvars['dateCompleted']=$values['dateCompleted']; ?>
</div>
<?php if ($show['repeat']) { ?>
<div class='formrow'>
<label for='repeat' class='left first'>Repeat every </label><input type='text' name='repeat' id='repeat' size='3' value='<?php echo $values['repeat']; ?>' /><label for='repeat'> days</label>
</div>
<?php } else $hiddenvars['repeat']=$values['repeat']; ?>
<div class='formrow'>
<?php
if (/*$show['isSomeday']*/ 1) { ?><br>
<label for='isSomeday' class='left first'>Sday/Maybe:</label> <input type='checkbox' name='isSomeday' id='isSomeday' value='y' title='Places item in Someday file'<?php
if ($values['isSomeday']==='y') echo " checked='checked' class='checked'";
else echo " class = 'unchecked'";
if ($values['itemId']) echo ajaxUpd('itemSomeday', $values['itemId']);
?> />
<?php } else $hiddenvars['isSomeday']=$values['isSomeday']; ?>
<!-- </div> -->
<input type='hidden' name='required'
value='title:notnull:Title can not be blank.,deadline:date:Deadline must be a valid date.,dateCompleted:date:Completion date is not valid.,suppress:depends:You must set a deadline to base the tickler on:deadline,suppress:depends:You must set a number of days for the tickler to be active from:suppressUntil' />
<input type='hidden' name='dateformat' value='ccyy-mm-dd' />
<?php
if (/*$show['suppress']*/ 1) { ?>
<!-- <div class='formrow'> -->
<label for='suppress' class='left'>Tickler:</label>
<input type='checkbox' name='suppress' id='suppress' value='y' title='Temporarily puts this into the tickler file, hiding it from the active view' <?php
if ($values['suppress']=="y") echo " checked='checked' class='checked'";
else echo " class = 'unchecked'";
if ($values['itemId']) echo ajaxUpd('itemTickler', $values['itemId']);
?>/>
<label for='suppressUntil'> </label>
<input type='text' size='3' name='suppressUntil' id='suppressUntil' value='<?php
echo $values['suppressUntil'] . "'";
if ($values['itemId']) echo ajaxUpd('itemTicklerDays', $values['itemId']);
?> /><label for='suppressUntil'> days before due date</label>
<label for='suppressIsDeadline' class='left'>Tickler date is deadline?</label>
<input type='checkbox' name='suppressIsDeadline' id='suppressIsDeadline' value='y' title='' <?php
if ($values['suppressIsDeadline']=="y") echo " checked='checked' class='checked'";
else echo " class='unchecked'";
if ($values['itemId']) echo ajaxUpd('itemTicklerDeadline', $values['itemId']);
?>/>
</div>
<?php } else {
$hiddenvars['suppress']=$values['suppress'];
$hiddenvars['suppressUntil']=$values['suppressUntil'];
}
if (!$values['itemId']) $hiddenvars['lastcreate']=$_SERVER['QUERY_STRING'];
foreach ($hiddenvars as $key=>$val) echo hidePostVar($key,$val);
$key='afterCreate'.$values['type'];
// always use config value when creating
if (!empty($config['afterCreate'][$values['type']]) && empty($_SESSION[$key]))
$_SESSION[$key]=$config['afterCreate'][$values['type']];
if ($values['itemId'] && !empty($_SESSION[$key]))
$tst=$_SESSION[$key];
else
$tst=$config['afterCreate'][$values['type']];
echo "<div class='formrow'>\n<label class='left first'>View"
,($values['itemId'])?/*'updating'*/'':''/*'creating'*/
,":</label> \n";
if ($show['ptitle'])
echo "<input type='radio' name='afterCreate' id='parentNext' value='parent' class='first'"
,($tst=='parent')?" checked='checked' ":""
," /><label for='parentNext' class='right'>Parent</label>\n";
echo "<input type='radio' name='afterCreate' id='itemNext' value='item' class='notfirst'"
,($tst=='item')?" checked='checked' ":""
," /><label for='itemNext' class='right'>Item</label>\n"
,"<input type='radio' name='afterCreate' id='listNext' value='list' class='notfirst'"
,($tst=='list')?" checked='checked' ":""
," /><label for='listNext' class='right'>Items</label>\n"
,"<input type='radio' name='afterCreate' id='anotherNext' value='another' class='notfirst'"
,($tst=='another')?" checked='checked' ":""
," /><label for='anotherNext' class='right'>Create another</label>\n";
if ($values['type']==='p')
echo "<input type='radio' name='afterCreate' id='childNext' value='child' class='notfirst'"
,($tst=='child')?" checked='checked' ":""
," /><label for='childNext' class='right'>Create action</label>\n";
if (!empty($hiddenvars['referrer']) || !empty($_SESSION[$key])) {
echo "<input type='radio' name='afterCreate' id='referrer' value='referrer' class='notfirst'"
,($tst=='referrer')?" checked='checked' ":''
," /><label for='referrer' class='right'>Previous</label>\n";
}
echo "</div>\n</div> <!-- form div -->\n<div class='formbuttons'>\n"
,"<input type='submit' value='"
,($values['itemId'])?"Update $typename":'Create'
,"' name='submit' />\n"
/*,"<input type='reset' value='Reset' />\n"*/;
if ($values['itemId']) {
echo "<input type='checkbox' name='delete' id='delete' value='y' title='Deletes item. Child items are orphaned, NOT deleted.'/>\n"
,"<label for='delete'>Delete $typename</label>\n"
,"<input type='hidden' name='oldtype' value='$oldtype' />\n";
}
echo "</div>\n</form>\n";
if ($values['itemId']) {
echo " <div class='detail'>\n";
echo " <span class='detail'> Created: " . substr($values['dateCreated'],0,10) . "</span>\n";
echo " <span class='detail'>Modified: " . substr($values['lastModified'],0,10) . "</span>\n";
echo " </div>\n";
}
if ($_SESSION['useLiveEnhancements'] && !empty($values['ptype'])) {
include_once ('searcher.inc.php');
$partt= $ptitle= $pid ='[';
$sep ='';
foreach ($potentialparents as $oneparent) {
$pid .=$sep.'"'.$oneparent['itemId'].'"';
$ptitle.=$sep.'"'.str_replace(array('\\','"'),array('\\\\','\\"'),$oneparent['title']).'"'; // escape backslashes and double-quotes
$partt .=$sep.'"'
.(($oneparent['isSomeday']==='y')?'s':$oneparent['type'])
.'"';
$sep =',';
}
$pid .=']';
$ptitle.=']';
$partt .=']';
if (count($allowedSearchTypes)===1) $partt='""';
// TOFIX - this javascript is very probably inefficient, but I don't have the resources to optimise it
?><script type='text/javascript'>
/* <![CDATA[ */
addEvent(window,'load',function() {
var types=new Object();
<?php
foreach ($alltypes as $key=>$val)
echo "types['$key']='$val';\n";
?>
mapTypeToName(types);
gtd_searchdiv_init(
<?php echo "$pid\n,\n$ptitle\n,\n$partt\n,\"{$values['ptype']}\" \n"; ?>
);
gtd_refinesearch('<?php echo $values['ptype']; ?>');
});
/* ]]> */
<?php //JK cursor focus
if ($values['itemId'] > 0) {
// echo "focusOnForm('description');";
echo "focusOnForm('nextAction');";
} else {
echo "focusOnForm('title');";
}
?>
</script><?php
}
include_once('footer.php');
function hidePostVar($name,$val) {
$val=makeclean($val);
return "<input type='hidden' name='$name' value='$val' />\n";
}
?>