Ejemplo n.º 1
0
function makeE(&$evt, $template, $type, $glue, $show = '1234567')
{
    //make event body using template
    global $set, $xx;
    $eArray = array();
    if ($type == 'br') {
        //type br
        foreach (str_split($template) as $fieldNr) {
            if (strpos($show, $fieldNr) !== false) {
                switch ($fieldNr) {
                    case '1':
                        if ($evt['ven']) {
                            $eArray[] = "{$xx['evt_venue']}: {$evt['ven']}";
                        }
                        break;
                    case '2':
                        $eArray[] = "{$xx['evt_category']}: {$evt['cnm']}";
                        break;
                    case '3':
                        if ($evt['des']) {
                            $eArray[] = $evt['des'];
                        }
                        break;
                    case '4':
                        if ($evt['xf1']) {
                            $eArray[] = ($set['xField1'] ? "{$set['xField1']}: " : '') . $evt['xf1'];
                        }
                        break;
                    case '5':
                        if ($evt['xf2']) {
                            $eArray[] = ($set['xField2'] ? "{$set['xField2']}: " : '') . $evt['xf2'];
                        }
                        break;
                    case '6':
                        if ($evt['rem'] >= 0) {
                            $eArray[] = "{$xx['vws_notify']}: {$evt['rem']} {$xx['vws_days']}";
                        }
                        break;
                    case '7':
                        $eArray[] = "{$xx['vws_added']}: " . IDTtoDDT($evt['adt']) . " ({$evt['una']})";
                        if ($evt['mdt'] and $evt['edr']) {
                            $eArray[] = "{$xx['vws_edited']}: " . IDTtoDDT($evt['mdt']) . " ({$evt['edr']})";
                        }
                }
            }
        }
    } else {
        //type td
        foreach (str_split($template) as $fieldNr) {
            if (strpos($show, $fieldNr) !== false) {
                switch ($fieldNr) {
                    case '1':
                        if ($evt['ven']) {
                            $eArray[] = "<tr><td>{$xx['evt_venue']}:</td><td>{$evt['ven']}</td></tr>";
                        }
                        break;
                    case '2':
                        $eArray[] = "<tr><td>{$xx['evt_category']}:</td><td>{$evt['cnm']}</td></tr>";
                        break;
                    case '3':
                        if ($evt['des']) {
                            $eArray[] = "<tr><td>{$xx['evt_description']}:</td><td>{$evt['des']}</td></tr>";
                        }
                        break;
                    case '4':
                        if ($evt['xf1']) {
                            $eArray[] = "<tr><td>{$set['xField1']}:</td><td>{$evt['xf1']}</td></tr>";
                        }
                        break;
                    case '5':
                        if ($evt['xf2']) {
                            $eArray[] = "<tr><td>{$set['xField2']}:</td><td>{$evt['xf2']}</td></tr>";
                        }
                        break;
                    case '6':
                        if ($evt['rem'] >= 0) {
                            $eArray[] = "<tr><td>{$xx['vws_notify']}:</td><td>{$evt['rem']} {$xx['vws_days']}</td></tr>";
                        }
                        break;
                    case '7':
                        $eArray[] = "<tr><td>{$xx['vws_added']}:</td><td>" . IDTtoDDT($evt['adt']) . " ({$evt['una']})</td></tr>";
                        if ($evt['mdt'] and $evt['edr']) {
                            $eArray[] = "<tr><td>{$xx['vws_edited']}:</td><td>" . IDTtoDDT($evt['mdt']) . " ({$evt['edr']})</td></tr>";
                        }
                }
            }
        }
    }
    return implode($glue, $eArray);
}
Ejemplo n.º 2
0
}
echo "<tr><td colspan='4'><hr></td></tr>\n\t<tr>\n\t\t<td>{$xx['evt_start_date']}:</td>\n\t\t<td><input type='text' name='sda' id='sda' value='{$sda}' size='8'><button title=\"{$xx['evt_select_date']}\" onclick=\"dPicker(0,'nill','sda','eda');return false;\">&larr;</button></td>\n\t\t<td id='dTimeS'{$hidden}><input type='text' name='sti' id='sti' value='{$sti}' size='6'><button title=\"{$xx['evt_select_time']}\" onclick=\"tPicker('sti');return false;\">&larr;</button></td>\n\t\t<td><input type='checkbox' onclick=\"hide_times(this);\" name='ald' id='ald' value='all'{$checked}><label for='ald'>{$xx['evt_all_day']}</label></td>\n\t</tr>\n\t<tr>\n\t\t<td>{$xx['evt_end_date']}:</td>\n\t\t<td><input type='text' name='eda' id='eda' value='{$eda}' size='8'><button title=\"{$xx['evt_select_date']}\" onclick=\"dPicker(1,'nill','eda','sda');return false;\">&larr;</button></td>\n\t\t<td id='dTimeE'{$hidden}><input type='text' name='eti' id='eti' value='{$eti}' size='6'><button title=\"{$xx['evt_select_time']}\" onclick=\"tPicker('eti');return false;\">&larr;</button></td>\n\t\t<td></td>\n\t</tr>\n\t<tr>\n\t\t<td colspan='4'>{$repTxt}&nbsp;<button class='noPrint' type='button' onclick=\"show('repBox');\">{$xx['evt_change']}</button><br></td>\n\t</tr>\n";
if ($set['mailServer']) {
    echo "<tr><td colspan='4'><hr></td></tr>\n\t\t\t<tr>\n<td>{$xx['evt_notify']}:</td>\n\t\t\t<td colspan='3'>\n\t\t\t<input type='checkbox' name='non' id='non' value='yes'" . ($non ? " checked='checked'" : '') . "><label for='non'>{$xx['evt_now_and_or']}</label>&nbsp;\n\t\t\t<input type='text' name='not' style='width:20px' maxlength='2' value=\"{$not}\"> {$xx['evt_days_before_event']}\n\t\t\t<span class='floatR arrow noPrint' onmouseover=\"pop(this,'" . htmlspecialchars($xx['evt_mail_help']) . "', 'normal')\">({$xx['evt_help']})</span>\n\t\t\t</td>\n</tr>\n\t\t\t<tr>\n\t\t\t<td colspan='4'>\n\t\t\t<input type='text' name='nml' id='nml' style='width:100%' maxlength='255' value=\"{$nml}\">\n\t\t\t</td>\n</tr>\n";
}
echo "<tr>\n<td colspan='4'><hr></td>\n</tr>\n\t\t<tr>\n<td>{$xx['evt_added']}:</td><td colspan='3'>" . IDTtoDDT($adt) . " {$xx['by']} ";
if ($privs > 3) {
    //manager or admin
    echo "<select name='uid' id='uid'>\n";
    userMenu($uid);
    echo "</select>\n";
} else {
    echo $own;
}
if ($mdt and $edr) {
    echo "</td>\n</tr>\n<tr>\n<td>{$xx['evt_edited']}:</td><td colspan='3'>" . IDTtoDDT($mdt) . " {$xx['by']} {$edr}";
}
echo "</td>\n</tr>\n</table>\n";
echo "<div class='repBox' id='repBox'>\n\t<div class='floatC'><b>{$xx['evt_set_repeat']}</b><hr></div>\n\t<div>\n\t\t<input type='radio' name='r_t' id='r_t0' value='0'" . (!$r_t ? " checked='checked'" : '') . "><label for='r_t0'>{$xx['evt_no_repeat']}</label>\n\t\t<br>\n\t\t<input type='radio' name='r_t' id='r_t1' value='1'" . ($r_t == "1" ? " checked='checked'" : '') . "><label for='r_t1'>{$xx['evt_repeat']}</label>\n\t\t<select name='ri1' id='ri1'>\n\t\t\t<option value='1'" . ($ri1 == '1' ? " selected='selected'>" : '>') . $xx['evt_interval1_1'] . "</option>\n\t\t\t<option value='2'" . ($ri1 == '2' ? " selected='selected'>" : '>') . $xx['evt_interval1_2'] . "</option>\n\t\t\t<option value='3'" . ($ri1 == '3' ? " selected='selected'>" : '>') . $xx['evt_interval1_3'] . "</option>\n\t\t\t<option value='4'" . ($ri1 == '4' ? " selected='selected'>" : '>') . $xx['evt_interval1_4'] . "</option>\n\t\t\t<option value='5'" . ($ri1 == '5' ? " selected='selected'>" : '>') . $xx['evt_interval1_5'] . "</option>\n\t\t\t<option value='6'" . ($ri1 == '6' ? " selected='selected'>" : '>') . $xx['evt_interval1_6'] . "</option>\n\t\t</select>\n\t\t<select name='rp1' id='rp1'>\n\t\t\t<option value='1'" . ($rp1 == '1' ? " selected='selected'>" : '>') . $xx['evt_period1_1'] . "</option>\n\t\t\t<option value='2'" . ($rp1 == '2' ? " selected='selected'>" : '>') . $xx['evt_period1_2'] . "</option>\n\t\t\t<option value='3'" . ($rp1 == '3' ? " selected='selected'>" : '>') . $xx['evt_period1_3'] . "</option>\n\t\t\t<option value='4'" . ($rp1 == '4' ? " selected='selected'>" : '>') . $xx['evt_period1_4'] . "</option>\n\t\t</select>\n\t\t<br>\n\t\t<input type='radio' name='r_t' id='r_t2' value='2'" . ($r_t == "2" ? 'checked="checked"' : '') . "><label for='r_t2'>{$xx['evt_repeat_on']}</label>\n\t\t<select name='ri2' id='ri2'>\n\t\t\t<option value='1'" . ($ri2 == '1' ? " selected='selected'>" : '>') . $xx['evt_interval2_1'] . "</option>\n\t\t\t<option value='2'" . ($ri2 == '2' ? " selected='selected'>" : '>') . $xx['evt_interval2_2'] . "</option>\n\t\t\t<option value='3'" . ($ri2 == '3' ? " selected='selected'>" : '>') . $xx['evt_interval2_3'] . "</option>\n\t\t\t<option value='4'" . ($ri2 == '4' ? " selected='selected'>" : '>') . $xx['evt_interval2_4'] . "</option>\n\t\t\t<option value='5'" . ($ri2 == '5' ? " selected='selected'>" : '>') . $xx['evt_interval2_5'] . "</option>\n\t\t</select>\n\t\t<select name='rp2' id='rp2'>\n\t\t\t<option value='1'" . ($rp2 == '1' ? " selected='selected'>" : '>') . $wkDays[1] . "</option>\n\t\t\t<option value='2'" . ($rp2 == '2' ? " selected='selected'>" : '>') . $wkDays[2] . "</option>\n\t\t\t<option value='3'" . ($rp2 == '3' ? " selected='selected'>" : '>') . $wkDays[3] . "</option>\n\t\t\t<option value='4'" . ($rp2 == '4' ? " selected='selected'>" : '>') . $wkDays[4] . "</option>\n\t\t\t<option value='5'" . ($rp2 == '5' ? " selected='selected'>" : '>') . $wkDays[5] . "</option>\n\t\t\t<option value='6'" . ($rp2 == '6' ? " selected='selected'>" : '>') . $wkDays[6] . "</option>\n\t\t\t<option value='7'" . ($rp2 == '7' ? " selected='selected'>" : '>') . $wkDays[7] . "</option>\n\t\t</select>\n\t\t{$xx['of']} \n\t\t<select name='rpm' id='rpm'>\n\t\t\t<option value='0'" . ($rpm == '0' ? " selected='selected'>" : '>') . $xx['evt_each_month'] . "</option>\n\t\t\t<option value='1'" . ($rpm == '1' ? " selected='selected'>" : '>') . $months[0] . "</option>\n\t\t\t<option value='2'" . ($rpm == '2' ? " selected='selected'>" : '>') . $months[1] . "</option>\n\t\t\t<option value='3'" . ($rpm == '3' ? " selected='selected'>" : '>') . $months[2] . "</option>\n\t\t\t<option value='4'" . ($rpm == '4' ? " selected='selected'>" : '>') . $months[3] . "</option>\n\t\t\t<option value='5'" . ($rpm == '5' ? " selected='selected'>" : '>') . $months[4] . "</option>\n\t\t\t<option value='6'" . ($rpm == '6' ? " selected='selected'>" : '>') . $months[5] . "</option>\n\t\t\t<option value='7'" . ($rpm == '7' ? " selected='selected'>" : '>') . $months[6] . "</option>\n\t\t\t<option value='8'" . ($rpm == '8' ? " selected='selected'>" : '>') . $months[7] . "</option>\n\t\t\t<option value='9'" . ($rpm == '9' ? " selected='selected'>" : '>') . $months[8] . "</option>\n\t\t\t<option value='10'" . ($rpm == '10' ? " selected='selected'>" : '>') . $months[9] . "</option>\n\t\t\t<option value='11'" . ($rpm == '11' ? " selected='selected'>" : '>') . $months[10] . "</option>\n\t\t\t<option value='12'" . ($rpm == '12' ? " selected='selected'>" : '>') . $months[11] . "</option>\n\t\t</select>\n\t\t<br><br>{$xx['evt_until']} \n\t\t<input type='text' name='rul' id='rul' value='{$rul}' size='9'>\n\t\t<button title=\"{$xx['evt_select_date']}\" onclick=\"dPicker(1,'nill','rul','sda');return false;\">&larr;</button> ({$xx['evt_blank_no_end']})\n\t</div>\n\t<div class='floatC'><hr><input type='submit' name='refresh' value=\"{$xx['evt_set']}\"></div>\n</div>\n<div class='floatC noPrint'>\n";
if ($mode == "add" or $mode == "add_exe") {
    echo "<input type='submit' name='add_exe_cls' value=\"{$xx['evt_add_close']}\">\n\t\t&nbsp;&nbsp;<input type='submit' name='add_exe' value=\"{$xx['evt_add']}\">";
} else {
    echo "<input type='submit' name='upd_exe_cls' value=\"{$xx['evt_save_close']}\">\n\t\t&nbsp;&nbsp;<input type='submit' name='upd_exe' value=\"{$xx['evt_save']}\">\n\t\t&nbsp;&nbsp;<input type='submit' name='add_exe' value=\"{$xx['evt_clone']}\">\n";
    if ($set['evtDelButton'] == 1 or $set['evtDelButton'] == 2 and $privs > 3) {
        echo "&nbsp;&nbsp;<input type='submit' name='del_exe' value=\"{$xx['evt_delete']}\">\n";
    }
}
echo "&nbsp;&nbsp;<button type='button' onclick='javascript:self.close();'>{$xx['evt_close']}</button>\n</div>\n</form>\n";
?>
<script>$I("tit").focus();</script>
Ejemplo n.º 3
0
if ($pri) {
    echo "<tr><td colspan='2'>{$xx['evt_private']}</td></tr>\n";
}
echo makeE($evtArr, $set['evtTemplGen'], 'td', "\n", '12345');
echo "<tr><td colspan='2'><hr></td></tr>\n\t<tr><td>{$xx['evt_date_time']}:</td><td>{$sda}";
if ($ald) {
    echo ($eda ? " - {$eda}" : '') . " {$xx['at_time']} {$xx['evt_all_day']}";
} else {
    echo " {$xx['at_time']} {$sti}";
    if ($eda) {
        echo " - {$eda}";
    }
    if ($eti) {
        echo ($eda ? " {$xx['at_time']} " : ' - ') . $eti;
    }
}
echo "</td></tr>\n";
if ($r_t) {
    echo "<tr><td colspan='2'>{$repTxt}<br></td></tr>\n";
}
if ($not != "" and ($privs > 2 or $privs == 2 and $uid == $_SESSION['uid'])) {
    //has rights to see email list
    echo "<tr><td colspan='2'><hr></td></tr>\n\n\t\t<tr><td>{$xx['evt_notify']}:</td>\n<td>{$not} {$xx['evt_days_before_event']}</td></tr>\n\t\t<tr><td colspan='2'>{$nml}</td></tr>\n";
}
echo "<tr><td colspan='2'><hr></td></tr>\n\t<tr><td>{$xx['evt_added']}:</td><td>" . IDTtoDDT($adt) . " {$xx['by']} {$own}";
if ($mdt and $edr) {
    echo "</td></tr>\n<tr><td>{$xx['evt_edited']}:</td><td>" . IDTtoDDT($mdt) . " {$xx['by']} {$edr}";
}
echo "</td></tr>\n";
echo "</table>\n";
echo "<div class='floatC noPrint'><button onClick='javascript:self.close();'>{$xx["evt_close"]}</button></div>\n";