added the user_summary column to the user_settings page
This commit is contained in:
parent
0e0ed921ed
commit
c703d151d1
@ -27,6 +27,7 @@ UPGRADING FROM 0.2.0
|
||||
mysql> ALTER TABLE issue_change ADD COLUMN(createdon datetime not null, createdby varchar(32) not null);
|
||||
mysql> UPDATE issue_change SET createdby=updatedby, createdon=updatedon;
|
||||
mysql> create the issue_coderev table according to the definition found in codepot.mysql
|
||||
mysql> ALTER TABLE user_settings ADD COLUMN(user_summary VARCHAR(255) NULL);
|
||||
|
||||
INSTALLATION ON CENTOS
|
||||
|
||||
|
@ -265,7 +265,8 @@ CREATE TABLE user_settings (
|
||||
userid VARCHAR(32) PRIMARY KEY,
|
||||
code_hide_line_num CHAR(1) NOT NULL,
|
||||
code_hide_metadata CHAR(1) NOT NULL,
|
||||
icon_name VARCHAR(255) UNIQUE NULL
|
||||
icon_name VARCHAR(255) UNIQUE NULL,
|
||||
user_summary VARCHAR(255) NULL
|
||||
) charset=utf8 engine=InnoDB;
|
||||
|
||||
CREATE TABLE user_account (
|
||||
|
@ -237,7 +237,8 @@ CREATE TABLE "cpot_user_settings" (
|
||||
"userid" VARCHAR(32) PRIMARY KEY,
|
||||
"code_hide_line_num" CHAR(1) NOT NULL,
|
||||
"code_hide_metadata" CHAR(1) NOT NULL,
|
||||
"icon_name" VARCHAR(255) UNIQUE NULL
|
||||
"icon_name" VARCHAR(255) UNIQUE NULL,
|
||||
"user_summary" VARCHAR(255) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "cpot_user_account" (
|
||||
|
@ -282,7 +282,8 @@ CREATE TABLE user_settings (
|
||||
userid VARCHAR(32) PRIMARY KEY,
|
||||
code_hide_line_num CHAR(1) NOT NULL,
|
||||
code_hide_metadata CHAR(1) NOT NULL,
|
||||
icon_name VARCHAR(255) UNIQUE NULL
|
||||
icon_name VARCHAR(255) UNIQUE NULL,
|
||||
user_summary VARCHAR(255) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE user_account (
|
||||
|
@ -49,6 +49,14 @@ class User extends Controller
|
||||
|
||||
$this->load->model ('ProjectModel', 'projects');
|
||||
$this->load->model ('IssueModel', 'issues');
|
||||
$this->load->model ('UserModel', 'users');
|
||||
|
||||
$user = new stdClass();
|
||||
$user->id = $userid;
|
||||
$user->xid = $this->converter->AsciiToHex($user->id);
|
||||
$user->summary = '';
|
||||
$settings = $this->users->fetchSettings ($user->id);
|
||||
if ($settings !== FALSE) $user->summary = $settings->user_summary;
|
||||
|
||||
$projects = $this->projects->getMyProjects ($userid);
|
||||
|
||||
@ -64,7 +72,7 @@ class User extends Controller
|
||||
{
|
||||
$data['login'] = $login;
|
||||
$data['projects'] = $projects;
|
||||
$data['target_userid'] = $userid;
|
||||
$data['user'] = $user;
|
||||
$data['issues'] = $issues;
|
||||
$data['issue_type_array'] = $this->issuehelper->_get_type_array($this->lang);
|
||||
$data['issue_status_array'] = $this->issuehelper->_get_status_array($this->lang);
|
||||
@ -91,10 +99,14 @@ class User extends Controller
|
||||
}
|
||||
|
||||
$this->load->model ('ProjectModel', 'projects');
|
||||
$this->load->model ('UserModel', 'users');
|
||||
|
||||
$user = new stdClass();
|
||||
$user->id = $userid;
|
||||
$user->xid = $this->converter->AsciiToHex($userid);
|
||||
$user->xid = $this->converter->AsciiToHex($user->id);
|
||||
$user->summary = '';
|
||||
$settings = $this->users->fetchSettings ($user->id);
|
||||
if ($settings !== FALSE) $user->summary = $settings->user_summary;
|
||||
|
||||
$myprojs = $this->projects->getMyProjects ($user->id);
|
||||
if ($myprojs === FALSE)
|
||||
@ -174,6 +186,13 @@ class User extends Controller
|
||||
$data['login'] = $login;
|
||||
$data['message'] = '';
|
||||
|
||||
$user = new stdClass();
|
||||
$user->id = $login['id'];
|
||||
$user->xid = $this->converter->AsciiToHex($user->id);
|
||||
$user->summary = '';
|
||||
$settings = $this->users->fetchSettings ($user->id);
|
||||
if ($settings !== FALSE) $user->summary = $settings->user_summary;
|
||||
|
||||
$icon_fname = FALSE;
|
||||
$uploaded_fname = FALSE;
|
||||
|
||||
@ -186,8 +205,9 @@ class User extends Controller
|
||||
if (strpos ($fname, ':') !== FALSE)
|
||||
{
|
||||
$data['message'] = $this->lang->line ('FILE_MSG_NAME_NO_COLON');
|
||||
$data['file'] = $file;
|
||||
$this->load->view ($this->VIEW_EDIT, $data);
|
||||
$data['settings'] = $settings;
|
||||
$data['user'] = $user;
|
||||
$this->load->view ($this->VIEW_SETTINGS, $data);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -216,7 +236,6 @@ class User extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// make sure that these field also exist in the database
|
||||
// also change the sanity check in LoginModel/getUser()
|
||||
@ -224,6 +243,7 @@ class User extends Controller
|
||||
//
|
||||
$settings->code_hide_line_num = $this->input->post('code_hide_line_num');
|
||||
$settings->code_hide_metadata = $this->input->post('code_hide_metadata');
|
||||
$settings->user_summary = $this->input->post('user_summary');
|
||||
|
||||
/* $uploaded_fname will be renamed to this name in users->storeSettings() */
|
||||
$settings->icon_name = $icon_fname;
|
||||
@ -233,14 +253,20 @@ class User extends Controller
|
||||
@unlink (CODEPOT_USERICON_DIR . '/' . $uploaded_fname);
|
||||
$data['message'] = 'DATABASE ERROR';
|
||||
$data['settings'] = $settings;
|
||||
$data['user'] = $user;
|
||||
$this->load->view ($this->VIEW_SETTINGS, $data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->login->setUserSettings ($settings);
|
||||
|
||||
// force change user->summary when the new settings has
|
||||
// been saved successfully.
|
||||
$user->summary = $settings->user_summary;
|
||||
|
||||
$data['message'] = 'SETTINGS STORED SUCCESSFULLY';
|
||||
$data['settings'] = $settings;
|
||||
$data['user'] = $user;
|
||||
$this->load->view ($this->VIEW_SETTINGS, $data);
|
||||
}
|
||||
}
|
||||
@ -254,9 +280,11 @@ class User extends Controller
|
||||
$settings->code_hide_line_num = ' ';
|
||||
$settings->code_hide_metadata = ' ';
|
||||
$settings->icon_name = '';
|
||||
$settings->user_summary = '';
|
||||
}
|
||||
|
||||
$data['settings'] = $settings;
|
||||
$data['user'] = $user;
|
||||
$this->load->view ($this->VIEW_SETTINGS, $data);
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ $lang['New'] = 'New';
|
||||
$lang['New directory'] = 'New directory';
|
||||
$lang['New file'] = 'New file';
|
||||
$lang['OK'] = 'OK';
|
||||
$lang['Oneliner about me'] = 'Oneliner about me';
|
||||
$lang['Open issues'] = 'Open issues';
|
||||
$lang['Other projects'] = 'Other projects';
|
||||
$lang['Overview'] = 'Overview';
|
||||
|
@ -73,6 +73,7 @@ $lang['New'] = 'Baru';
|
||||
$lang['New directory'] = 'Direktori baru';
|
||||
$lang['New file'] = 'File baru';
|
||||
$lang['OK'] = 'OK';
|
||||
$lang['Oneliner about me'] = 'Oneliner about me';
|
||||
$lang['Open issues'] = 'Open issues';
|
||||
$lang['Other projects'] = 'Proyek lain';
|
||||
$lang['Overview'] = 'Ringkasan';
|
||||
|
@ -73,6 +73,7 @@ $lang['New'] = '신규';
|
||||
$lang['New directory'] = 'New directory';
|
||||
$lang['New file'] = 'New file';
|
||||
$lang['OK'] = '확인';
|
||||
$lang['Oneliner about me'] = '짧은 인사말';
|
||||
$lang['Open issues'] = '미처리이슈';
|
||||
$lang['Other projects'] = '다른 프로젝트';
|
||||
$lang['Overview'] = '개요';
|
||||
|
@ -55,6 +55,7 @@ class UserModel extends Model
|
||||
$this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num);
|
||||
$this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata);
|
||||
if ($icon_name_set) $this->db->set ('icon_name', (string)$settings->icon_name);
|
||||
$this->db->set ('user_summary', (string)$settings->user_summary);
|
||||
$this->db->insert ('user_settings');
|
||||
}
|
||||
else
|
||||
@ -63,6 +64,7 @@ class UserModel extends Model
|
||||
$this->db->set ('code_hide_line_num', (string)$settings->code_hide_line_num);
|
||||
$this->db->set ('code_hide_metadata', (string)$settings->code_hide_metadata);
|
||||
if ($icon_name_set) $this->db->set ('icon_name', (string)$settings->icon_name);
|
||||
$this->db->set ('user_summary', (string)$settings->user_summary);
|
||||
$this->db->update ('user_settings');
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,54 @@ foreach ($urls as $url)
|
||||
</div> <!-- project_home_result_wiki -->
|
||||
</div>
|
||||
|
||||
<?php if (isset($login['id']) && $login['id'] != ''): ?>
|
||||
<div id='project_home_new_form'>
|
||||
<div style='line-height: 2em;'>
|
||||
<?php
|
||||
print form_dropdown (
|
||||
'project_home_new_type',
|
||||
$project_type_array,
|
||||
set_value('project_home_new_type', ''),
|
||||
'id="project_home_new_type"'
|
||||
);
|
||||
print ' ';
|
||||
|
||||
$tmpmemb = array();
|
||||
foreach ($project->members as $m) $tmpmemb[$m] = $m;
|
||||
print form_dropdown (
|
||||
'project_home_new_owner',
|
||||
$tmpmemb,
|
||||
set_value('project_home_new_owner', (in_array($login['id'], $project->members)? $login['id']: '')),
|
||||
'id="project_home_new_owner"'
|
||||
);
|
||||
?>
|
||||
|
||||
<input type='text' id='project_home_new_summary' name='project_home_new_summary' size='50' placeholder='<?php print $this->lang->line('Summary'); ?>'/>
|
||||
</div>
|
||||
|
||||
<div id='project_home_new_description_tabs' style='width:100%;'>
|
||||
<ul>
|
||||
<li><a href='#project_home_new_description_input'><?php print $this->lang->line('Description'); ?></a></li>
|
||||
<li><a href='#project_home_new_description_preview'><?php print $this->lang->line('Preview'); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id='project_home_new_description_input'>
|
||||
<textarea type='textarea' id='project_home_new_description' name='project_home_new_description' rows=24 cols=100 style='width:100%;'></textarea>
|
||||
|
||||
<div style='margin-top: 0.1em;'>
|
||||
<?php print $this->lang->line('Attachments'); ?>
|
||||
<input type='file' id='project_home_new_files' name='project_home_new_files' multiple='' autocomplete='off' style='color: transparent;' />
|
||||
<table id='project_home_new_file_table'></table>
|
||||
</div>
|
||||
</div>
|
||||
<div id='project_home_new_description_preview' class='codepot-styled-text-preview'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id='project_home_alert'></div>
|
||||
|
||||
</div> <!-- project_home_mainarea -->
|
||||
|
||||
|
||||
|
@ -60,9 +60,9 @@ function show_projectbar ($con, $banner, $page, $ctxmenuitems)
|
||||
{
|
||||
if (isset($site)) print htmlspecialchars($site->summary);
|
||||
}
|
||||
else if ($type == 'user')
|
||||
else if ($type == 'user' || $type == 'user-other')
|
||||
{
|
||||
// anything?
|
||||
if (isset($user)) print htmlspecialchars($user->summary);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -40,18 +40,15 @@ $(function () {
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<?php
|
||||
$user = new stdClass();
|
||||
if ($target_userid == $login['id'])
|
||||
|
||||
if ($user->id == $login['id'])
|
||||
{
|
||||
$user->id = $login['id'];
|
||||
$projectbar_type = 'user';
|
||||
}
|
||||
else
|
||||
{
|
||||
$user->id = $target_userid;
|
||||
$projectbar_type = 'user-other';
|
||||
}
|
||||
$user->xid = $this->converter->AsciiTohex($user->id);
|
||||
|
||||
$this->load->view (
|
||||
'projectbar',
|
||||
|
@ -27,10 +27,6 @@
|
||||
<!---------------------------------------------------------------------------->
|
||||
|
||||
<?php
|
||||
$user = new stdClass();
|
||||
$user->id = $login['id'];
|
||||
$user->xid = $this->converter->AsciiToHex($user->id);
|
||||
|
||||
$this->load->view (
|
||||
'projectbar',
|
||||
array (
|
||||
@ -71,6 +67,8 @@ $this->load->view (
|
||||
?>
|
||||
<?php print $this->lang->line('USER_MSG_HIDE_METADATA')?>
|
||||
|
||||
<hr style="height:1px; border:none; background-color:#CCCCCC;" />
|
||||
|
||||
<div class='form_input_field'>
|
||||
<?php print form_label($this->lang->line('Icon').': ', 'icon_img_file_name')?>
|
||||
<?php
|
||||
@ -81,6 +79,13 @@ $this->load->view (
|
||||
(.png, max. 100x100)
|
||||
</div>
|
||||
|
||||
<hr style="height:1px; border:none; background-color:#CCCCCC;" />
|
||||
|
||||
<?php print form_label($this->lang->line('Oneliner about me').': ', 'user_summary')?>
|
||||
<input type="text" name="user_summary" size="50" value="<?php print addslashes($settings->user_summary); ?>" />
|
||||
|
||||
<hr style="height:1px; border:none; background-color:#CCCCCC;" />
|
||||
|
||||
<div class="buttons">
|
||||
<?php print form_submit('settings', $this->lang->line('OK'))?>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user