/**
  * @param BRANCH $branch Branch from which releases are retrieved.
  */
 public function __construct($branch)
 {
     $folder = $branch->parent_folder();
     parent::__construct($folder);
     $this->_branch = $branch;
     release_query_order($this);
 }
 /**
  * @param BRANCH $branch Branch for which comments are retrieved.
  */
 public function __construct($branch)
 {
     $folder = $branch->parent_folder();
     parent::__construct($folder);
     $this->_branch = $branch;
     $table_names = $this->app->table_names;
     $this->add_select('entry.kind as entry_kind, chng.number as chng_number, chng.job_id as chng_job_id, etob.branch_release_id' . ', jtob.branch_status, jtob.branch_priority, jtob.branch_closer_id' . ', jtob.branch_time_closed, entry.time_created as job_time_created');
     $this->add_table("{$table_names->changes} chng", 'chng.entry_id = entry.id', 'LEFT');
     $this->add_table("{$table_names->jobs} job", 'job.entry_id = entry.id', 'LEFT');
     $this->add_table("{$table_names->entries_to_branches} etob", 'etob.entry_id = entry.id');
     $this->add_table("{$table_names->jobs_to_branches} jtob", 'jtob.entry_to_branch_id = etob.id', 'LEFT');
 }
 /**
  * @param BRANCH $obj Configure commands for this branch.
  */
 public function __construct($obj)
 {
     parent::__construct($obj->app);
     $folder = $obj->parent_folder();
     if (!$folder->is_organizational() && !$obj->locked()) {
         $this->append_group('Create');
         $cmd = $this->make_command();
         $cmd->id = 'new_job';
         $cmd->caption = 'New job';
         $cmd->link = "create_job.php?id={$folder->id}&branch_id={$obj->id}";
         $cmd->icon = '{app_icons}buttons/new_job';
         $cmd->executable = $this->login->is_allowed(Privilege_set_entry, Privilege_create, $obj);
         $cmd->importance = Command_importance_high + Command_importance_increment;
         $this->append($cmd);
         $cmd = $this->make_command();
         $cmd->id = 'new_change';
         $cmd->caption = 'New change';
         $cmd->link = "create_change.php?id={$folder->id}&branch_id={$obj->id}";
         $cmd->icon = '{app_icons}buttons/new_change';
         $cmd->executable = $this->login->is_allowed(Privilege_set_entry, Privilege_create, $obj);
         $cmd->importance = Command_importance_high + Command_importance_increment;
         $this->append($cmd);
         $cmd = $this->make_command();
         $cmd->id = 'new_release';
         $cmd->caption = 'New release';
         $cmd->link = "create_release.php?id={$obj->id}";
         $cmd->icon = '{app_icons}buttons/new_release';
         $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_modify, $obj);
         $cmd->importance = Command_importance_low;
         $this->append($cmd);
         $cmd = $this->make_command();
         $cmd->id = 'new_branch';
         $cmd->caption = 'New branch';
         $cmd->link = "create_branch.php?id={$folder->id}&branch_id={$obj->id}";
         $cmd->icon = '{app_icons}buttons/new_branch';
         $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_modify, $obj);
         $cmd->importance = Command_importance_high - 2 * Command_importance_increment;
         $cmd->importance = Command_importance_low;
         $this->append($cmd);
     }
     $cmd = $this->make_command();
     $this->append_group('Edit');
     $cmd->id = 'edit';
     $cmd->caption = 'Edit';
     $cmd->link = "edit_branch.php?id={$obj->id}";
     $cmd->icon = '{icons}buttons/edit';
     $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_modify, $obj);
     $cmd->importance = Command_importance_high - Command_importance_increment;
     $this->append($cmd);
     if (!$folder->is_root()) {
         $cmd = $this->make_command();
         $cmd->id = 'delete';
         $cmd->caption = 'Delete';
         $cmd->link = "delete_branch.php?id={$obj->id}";
         $cmd->icon = '{icons}buttons/delete';
         $cmd->executable = !$obj->deleted() && $this->login->is_allowed(Privilege_set_folder, Privilege_modify, $obj);
         $cmd->importance = Command_importance_high - 2 * Command_importance_increment;
         $this->append($cmd);
         $cmd = $this->make_command();
         $cmd->id = 'purge';
         $cmd->caption = 'Purge';
         $cmd->link = "purge_branch.php?id={$obj->id}";
         $cmd->icon = '{icons}buttons/purge';
         $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_purge, $obj);
         $cmd->importance = Command_importance_high - 2 * Command_importance_increment;
         $this->append($cmd);
     }
     $this->append_group('View');
     $cmd = $this->make_command();
     $cmd->id = 'print';
     $cmd->caption = 'Print';
     $cmd->link = "view_branch_change_log.php?id={$obj->id}&printable=1";
     $cmd->icon = '{icons}buttons/print';
     $cmd->executable = true;
     $cmd->importance = Command_importance_high - Command_importance_increment;
     $this->append($cmd);
     $cmd = $this->make_command();
     $cmd->id = 'history';
     $cmd->caption = 'History';
     $cmd->link = "view_branch_history.php?id={$obj->id}";
     $cmd->icon = '{icons}buttons/history';
     $cmd->executable = $this->login->is_allowed(Privilege_set_folder, Privilege_view_history, $obj);
     $cmd->importance = Command_importance_low;
     $this->append($cmd);
     $cmd = $this->make_command();
     $cmd->id = 'change_log';
     $cmd->caption = 'View change log';
     $cmd->link = "view_branch_change_log.php?id={$obj->id}";
     $cmd->icon = '{app_icons}buttons/change_log';
     $cmd->executable = true;
     $cmd->importance = Command_importance_high;
     $this->append($cmd);
 }
 /**
  * @param BRANCH $branch Branch for which entries are retrieved.
  */
 public function __construct($branch)
 {
     $folder = $branch->parent_folder();
     parent::__construct($folder);
     $this->_branch = $branch;
 }