Example #1
0
 function do_job()
 {
     require_once iPHP_APP_CORE . '/iJob.class.php';
     $job = new JOB();
     $this->uid or $this->uid = iMember::$userid;
     $job->count_post($this->uid);
     $month = $job->month();
     $pmonth = $job->month($job->pmonth['start']);
     $rs = iDB::row("SELECT * FROM `#iCMS@__members` WHERE `uid`='{$this->uid}' LIMIT 1;");
     include iACP::view("account.job");
 }
 /**
  * @param JOB $obj Retrieve the title from this job.
  * @return string
  * @access private
  */
 protected function _text_for_list($obj)
 {
     $props = $obj->kind_properties();
     $Result = $this->context->get_icon_with_text($props->icon, Sixteen_px, parent::_text_for_list($obj));
     /** @var $branch_info JOB_BRANCH_INFO */
     $branch_info = $obj->main_branch_info();
     if ($branch_info->is_closed()) {
         return "<span class=\"locked\">{$Result}</span>";
     }
     return $Result;
 }
    /**
     * Draws the list of {@link CHANGE}s.
     * @param JOB $obj
     * @param OBJECT_RENDERER_OPTIONS $options
     */
    public function display($obj, $options = null)
    {
        $change_query = $obj->change_query();
        $num_changes = $change_query->size();
        if ($num_changes) {
            ?>
<h2>
  <?php 
            echo $num_changes;
            ?>
 Changes
</h2>
<div class="grid-content">
<?php 
            $class_name = $this->app->final_class_name('CHANGE_GRID', 'projects/gui/change_grid.php');
            /** @var $grid CHANGE_GRID */
            $grid = new $class_name($this->app, read_var('search_text'));
            $grid->set_page_size(Default_page_size);
            $grid->set_query($change_query);
            $grid->display();
            ?>
</div>
<?php 
        }
        parent::display($obj, $options);
    }
 /**
  * Record class-specific differences.
  * 'orig' is the same as {@link $_object}, but is passed here for convenience.
  * @param JOB $orig
  * @param JOB $new
  * @access private
  */
 protected function _record_differences($orig, $new)
 {
     if ($orig->reporter_id != $new->reporter_id) {
         $this->_record_object_difference('Reporter', $orig->reporter(), $new->reporter());
     }
     parent::_record_differences($orig, $new);
     $this->_record_time_difference('Time needed', $orig->time_needed, $new->time_needed);
     if ($orig->assignee_id != $new->assignee_id) {
         $this->_record_object_difference('Assignee', $orig->assignee(), $new->assignee());
     }
 }
Example #5
0
    /**
     * Draw user-specific information for the given release.
     * @param JOB $obj
     * @param JOB_BRANCH_INFO $branch_info
     */
    protected function _draw_user_details($obj, $branch_info)
    {
        $is_closed = $branch_info->is_closed();
        $time_open = $branch_info->age();
        $time_in_status = $branch_info->status_age();
        if (!$is_closed) {
            $needed_by = $branch_info->needed_by_as_html();
            if ($needed_by) {
                ?>
  <div>
    <?php 
                echo $needed_by;
                ?>
  </div>
  <?php 
            }
        }
        ?>
  <div>
    <span class="field"><?php 
        $status_props = $branch_info->status_properties();
        echo $this->app->get_icon_with_text($status_props->icon, Sixteen_px, $status_props->title);
        ?>
</span>
  <?php 
        if ($is_closed) {
            $closer = $branch_info->closer();
            ?>
    (<?php 
            echo $branch_info->time_closed->format();
            ?>
    by <?php 
            echo $closer->title_as_link();
            ?>
    after <?php 
            echo $time_open->format();
            ?>
)
  <?php 
        } else {
            if ($time_open->equals($time_in_status)) {
                ?>
  (<?php 
                echo $time_open->format();
                ?>
)
  <?php 
            } else {
                ?>
  &ndash; <?php 
                echo $time_in_status->format();
                ?>
 (open for <?php 
                echo $time_open->format();
                ?>
)
  <?php 
            }
        }
        ?>
  </div>
  <?php 
        if (!$is_closed) {
            ?>
  <div>
    <?php 
            $priority_props = $branch_info->priority_properties();
            echo $this->app->get_icon_with_text($priority_props->icon, Sixteen_px, $priority_props->title);
            ?>
  </div>
  <?php 
        }
        ?>
  <div>
    <div>
    <?php 
        if (!$is_closed) {
            $assignee = $obj->assignee();
            if ($assignee) {
                $text = 'Assigned to ' . $assignee->title_as_link();
                $time_owned = $obj->assignee_age();
                if (isset($time_owned)) {
                    $text .= ' (' . $time_owned->format() . ')';
                }
            } else {
                $text = 'Not assigned';
            }
            echo $this->app->get_icon_with_text($obj->get_assignee_icon_url(), Sixteen_px, $text);
        }
        ?>
    </div>
    <div class="clear-both"></div>
  </div>
  <?php 
    }
Example #6
0
 /**
  * Store the form's values for this job.
  * @param JOB $obj
  * @access private
  */
 protected function _store_to_object($obj)
 {
     $obj->set_assignee_id($this->value_for('assignee_id'));
     $obj->reporter_id = $this->value_for('reporter_id');
     $obj->set_time_needed($this->value_for('time_needed'));
     parent::_store_to_object($obj);
 }