예제 #1
0
 function _action_submit_intervals()
 {
     // parse results from response
     $ruleId = _post('id');
     $rule = $this->getRuleManager()->getRule($ruleId);
     // new intervals object
     $intervals = new ReminderIntervals();
     $change = false;
     foreach (ReminderIntervalType::values() as $type) {
         foreach (ReminderIntervalRange::values() as $range) {
             $amtKey = $type->code . "-" . $range->code;
             $timeKey = $amtKey . "-timeunit";
             $amt = _post($amtKey);
             $timeUnit = TimeUnit::from(_post($timeKey));
             if ($amt && $timeUnit) {
                 $detail = new ReminderIntervalDetail($type, $range, $amt, $timeUnit);
                 $intervals->addDetail($detail);
                 $change = true;
             }
         }
     }
     if ($change) {
         $this->getRuleManager()->updateIntervals($rule, $intervals);
     }
     $this->redirect("index.php?action=detail!view&id={$ruleId}");
 }
예제 #2
0
"/>

    <div class="intervals">
        <p>
            <span class="left_col colhead"><u><?php 
echo out(xl('Type'));
?>
</u></span>
            <span class="end_col colhead"><u><?php 
echo out(xl('Detail'));
?>
</u></span>
        </p>

    <?php 
foreach (ReminderIntervalType::values() as $type) {
    ?>
    <?php 
    foreach (ReminderIntervalRange::values() as $range) {
        ?>
    <?php 
        $first = true;
        $detail = $intervals->getDetailFor($type, $range);
        ?>
        <p>
            <span class="left_col <?php 
        echo $first ? "req" : "";
        ?>
" data-grp="<?php 
        echo out($type->code);
        ?>