/** * Add commands that edit the picture. * @param PICTURE $entry * @access private */ protected function _add_editors($entry) { parent::_add_editors($entry); $last_page = urlencode($this->env->url(Url_part_all)); $cmd = $this->make_command(); $cmd->id = 'make_key_photo'; $cmd->caption = 'Make Key Photo'; $cmd->link = "make_key_photo.php?id={$entry->id}&last_page={$last_page}"; $cmd->icon = '{icons}buttons/password'; $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_modify, $entry->parent_folder()); $cmd->importance = Command_importance_high; $this->append($cmd); }
/** * Add commands that edit the entry. * @param JOB $entry * @access private */ protected function _add_editors($entry) { parent::_add_editors($entry); $branch_info = $entry->main_branch_info(); $last_page = urlencode($this->env->url(Url_part_all)); $branch = $branch_info->branch(); $release = $branch_info->release(); $locked = $branch->locked() || isset($release) && $release->locked(); $cmd = $this->make_command(); $cmd->id = 'work'; $cmd->caption = 'Start working'; $cmd->link = "set_job_status.php?id={$entry->id}&status=3&branch_id={$branch_info->branch_id}&last_page={$last_page}"; $cmd->icon = '{app_icons}statuses/working'; $cmd->importance = Command_importance_high + Command_importance_increment; $cmd->executable = !$locked && !$branch_info->is_closed() && $branch_info->status != 3 && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry); $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'work'; $cmd->caption = 'Stop working'; $cmd->link = "set_job_status.php?id={$entry->id}&status=4&branch_id={$branch_info->branch_id}&last_page={$last_page}"; $cmd->icon = '{app_icons}statuses/stopped'; $cmd->importance = Command_importance_high + Command_importance_increment; $cmd->executable = !$locked && !$branch_info->is_closed() && $branch_info->status == 3 && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry); $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'fix'; $cmd->caption = 'Mark as fixed'; $cmd->link = "set_job_status.php?id={$entry->id}&status=7&branch_id={$branch_info->branch_id}&last_page={$last_page}"; $cmd->icon = '{app_icons}statuses/released'; $cmd->importance = Command_importance_high + Command_importance_increment; $cmd->executable = !$locked && !$branch_info->is_closed() && $branch_info->status != 7 && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry); $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'reopen'; $cmd->caption = 'Re-open'; $cmd->link = "set_job_status.php?id={$entry->id}&status=1&branch_id={$branch_info->branch_id}&last_page={$last_page}"; $cmd->icon = '{app_icons}statuses/reopened'; $cmd->importance = Command_importance_high + Command_importance_increment; $cmd->executable = !$locked && $branch_info->is_closed() && $branch_info->status != 1 && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry); $this->append($cmd); }
/** * Add commands that edit the entry. * @param ENTRY $entry * @access private */ protected function _add_editors($entry) { $last_page = urlencode($this->env->url(Url_part_all)); parent::_add_editors($entry); $cmd = $this->make_command(); $cmd->id = 'publish'; $cmd->caption = 'Publish'; $cmd->link = "set_published.php?id={$entry->id}&last_page={$last_page}"; $cmd->icon = '{icons}buttons/ship'; $cmd->executable = $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry) && $entry->unpublished(); $cmd->importance = Command_importance_high; $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'abandon'; $cmd->caption = 'Abandon'; $cmd->link = "set_abandoned.php?id={$entry->id}&last_page={$last_page}"; $cmd->icon = '{icons}buttons/abandon'; $cmd->executable = !$entry->abandoned() && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry) && $entry->unpublished(); $cmd->importance = Command_importance_default; $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'queue'; $cmd->caption = 'Queue'; $cmd->link = "set_queued.php?id={$entry->id}&last_page={$last_page}"; $cmd->icon = '{icons}buttons/queue'; $cmd->executable = !$entry->queued() && $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry) && $entry->unpublished(); $cmd->importance = Command_importance_default; $this->append($cmd); $cmd = $this->make_command(); $cmd->id = 'unpublish'; $cmd->caption = 'Unpublish'; $cmd->link = "set_draft.php?id={$entry->id}&last_page={$last_page}"; $cmd->icon = '{icons}buttons/unpublish'; $cmd->executable = $this->login->is_allowed(Privilege_set_entry, Privilege_modify, $entry) && $entry->visible(); $cmd->importance = Command_importance_default; $this->append($cmd); }