From 02aa6ec6f29dc15bf9d2feaa9ed0ceb17a9b3b63 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 7 Apr 2010 12:13:44 +0000 Subject: [PATCH] changed the way the projectbar view is used. added the rpm spec file. --- codepot/Makefile.am | 9 ++ codepot/Makefile.in | 20 ++- codepot/codepot.spec.in | 81 ++++++++++ codepot/configure | 3 +- codepot/configure.ac | 1 + codepot/src/codepot/config/lang_detect.php | 4 +- codepot/src/codepot/controllers/Makefile.am | 1 + codepot/src/codepot/controllers/Makefile.in | 1 + codepot/src/codepot/controllers/site.php | 73 ++++----- codepot/src/codepot/controllers/user.php | 141 ++++++++++++++++++ .../codepot/language/english/common_lang.php | 3 + .../language/indonesian/common_lang.php | 5 +- .../codepot/language/korean/common_lang.php | 3 + codepot/src/codepot/models/issuemodel.php | 8 +- codepot/src/codepot/models/logmodel.php | 33 +++- codepot/src/codepot/views/code_blame.php | 9 +- codepot/src/codepot/views/code_diff.php | 9 +- codepot/src/codepot/views/code_file.php | 9 +- codepot/src/codepot/views/code_folder.php | 9 +- codepot/src/codepot/views/code_history.php | 9 +- codepot/src/codepot/views/code_revision.php | 9 +- codepot/src/codepot/views/error.php | 16 +- codepot/src/codepot/views/file_delete.php | 9 +- codepot/src/codepot/views/file_edit.php | 9 +- codepot/src/codepot/views/file_home.php | 9 +- codepot/src/codepot/views/file_show.php | 9 +- codepot/src/codepot/views/issue_delete.php | 9 +- codepot/src/codepot/views/issue_edit.php | 9 +- codepot/src/codepot/views/issue_home.php | 9 +- codepot/src/codepot/views/issue_show.php | 9 +- codepot/src/codepot/views/log.php | 108 +++++++++++++- codepot/src/codepot/views/login.php | 10 +- codepot/src/codepot/views/project_catalog.php | 9 +- codepot/src/codepot/views/project_delete.php | 9 +- codepot/src/codepot/views/project_edit.php | 10 +- codepot/src/codepot/views/project_home.php | 9 +- codepot/src/codepot/views/projectbar.php | 48 ++++-- codepot/src/codepot/views/site_catalog.php | 10 +- codepot/src/codepot/views/site_delete.php | 10 +- codepot/src/codepot/views/site_edit.php | 10 +- codepot/src/codepot/views/site_home.php | 12 +- codepot/src/codepot/views/site_show.php | 10 +- codepot/src/codepot/views/taskbar.php | 2 +- codepot/src/codepot/views/user_home.php | 44 +++--- codepot/src/codepot/views/wiki_delete.php | 9 +- codepot/src/codepot/views/wiki_edit.php | 9 +- codepot/src/codepot/views/wiki_home.php | 9 +- codepot/src/codepot/views/wiki_show.php | 9 +- 48 files changed, 696 insertions(+), 169 deletions(-) create mode 100644 codepot/codepot.spec.in create mode 100644 codepot/src/codepot/controllers/user.php diff --git a/codepot/Makefile.am b/codepot/Makefile.am index f0e7213a..453665a5 100644 --- a/codepot/Makefile.am +++ b/codepot/Makefile.am @@ -27,3 +27,12 @@ deb: dist-gzip $(RM) -r "$(PACKAGE)-$(VERSION)" mv -f "/var/tmp/$(PACKAGE)-$(VERSION).deb" . +rpm: dist + rm -rf "@abs_top_builddir@/RPM/BUILD" + mkdir -p "@abs_top_builddir@/RPM/BUILD" + mkdir -p "@abs_top_builddir@/RPM/SOURCES" + mkdir -p "@abs_top_builddir@/RPM/SRPMS" + mkdir -p "@abs_top_builddir@/RPM/RPMS" + cp codepot-@VERSION@.tar.gz "@abs_top_builddir@/RPM/SOURCES" + rpmbuild --define "_topdir @abs_top_builddir@/RPM" \ + -ba codepot.spec --target=@build_cpu@ diff --git a/codepot/Makefile.in b/codepot/Makefile.in index fd5245c3..e3de6437 100644 --- a/codepot/Makefile.in +++ b/codepot/Makefile.in @@ -33,9 +33,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure ac/aux/install-sh ac/aux/missing \ - config.guess config.sub + $(srcdir)/Makefile.in $(srcdir)/codepot.spec.in \ + $(srcdir)/config.h.in $(top_srcdir)/configure \ + ac/aux/install-sh ac/aux/missing config.guess config.sub ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac/m4/as-ac-expand.m4 \ $(top_srcdir)/configure.ac @@ -45,7 +45,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = codepot.spec CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = @@ -254,6 +254,8 @@ $(srcdir)/config.h.in: $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +codepot.spec: $(top_builddir)/config.status $(srcdir)/codepot.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -706,6 +708,16 @@ deb: dist-gzip $(RM) -r "$(PACKAGE)-$(VERSION)" mv -f "/var/tmp/$(PACKAGE)-$(VERSION).deb" . +rpm: dist + rm -rf "@abs_top_builddir@/RPM/BUILD" + mkdir -p "@abs_top_builddir@/RPM/BUILD" + mkdir -p "@abs_top_builddir@/RPM/SOURCES" + mkdir -p "@abs_top_builddir@/RPM/SRPMS" + mkdir -p "@abs_top_builddir@/RPM/RPMS" + cp codepot-@VERSION@.tar.gz "@abs_top_builddir@/RPM/SOURCES" + rpmbuild --define "_topdir @abs_top_builddir@/RPM" \ + -ba codepot.spec --target=@build_cpu@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/codepot/codepot.spec.in b/codepot/codepot.spec.in new file mode 100644 index 00000000..94845b70 --- /dev/null +++ b/codepot/codepot.spec.in @@ -0,0 +1,81 @@ +%define _prefix /usr +%define _sysconfdir /etc + +Summary: Codepot code repository manager +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 1 +License: GPL +Source0: %{name}-%{version}.tar.gz + +Requires: httpd php php-ldap php-mysql + +BuildRequires: +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%descriptoin +Codepot code repository manager + +%prep +%setup -q + +%build +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-wwwdir=/var/www/html/codepot \ + --with-cfgdir=/etc/codepot \ + --with-depotdir=/var/lib/codepot \ + --with-logdir=/var/log/codepot \ + --with-cachedir=/var/cache/codepot +make + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-, root, root) + +%pre +exit 0 + +%post +# create directories not handled by make install +[ -d "@CACHEDIR@" ] || { mkdir -p "@CACHEDIR@" && cachedir=1; } +[ -d "@LOGDIR@" ] || { mkdir -p "@LOGDIR@" && logdir=1; } +[ -d "@DEPOTDIR@/svnrepo" ] || { mkdir -p "@DEPOTDIR@/svnrepo" && svnrepodir=1; } +[ -d "@DEPOTDIR@/files" ] || { mkdir -p "@DEPOTDIR@/files" && filesdir=1; } + +GROUP=apache:apache +[ "${cachedir}" = "1" ] && { + chgrp -R "${GROUP}" "@CACHEDIR@" + chmod 0775 "@CACHEDIR@" +} +[ "${logdir}" = "1" ] && { + chgrp -R "${GROUP}" "@LOGDIR@" + chmod 0775 "@LOGDIR@" +} +[ "${svnrepodir}" = "1" ] && { + chgrp -R "${GROUP}" "@DEPOTDIR@/svnrepo" + chmod 0775 "@DEPOTDIR@/svnrepo" +} +[ "${filesdir}" = "1" ] && { + chgrp -R "${GROUP}" "@DEPOTDIR@/files" + chmod 0775 "@DEPOTDIR@/files" +} + +exit 0 + +%preun +exit 0 + +%postun +[ -d "@CACHEDIR@" ] && rmdir "@CACHEDIR@" 2>/dev/null +[ -d "@LOGDIR@" ] && rmdir "@LOGDIR@" 2>/dev/null +[ -d "@DEPOTDIR@/svnrepo" ] && rmdir "@DEPOTDIR@/svnrepo" 2>/dev/null +[ -d "@DEPOTDIR@/files" ] && rmdir "@DEPOTDIR@/files" 2>/dev/null +[ -d "@DEPOTDIR@" ] && rmdir "@DEPOTDIR@" 2>/dev/null +exit 0 diff --git a/codepot/configure b/codepot/configure index f4932f4b..4ecd2c9b 100755 --- a/codepot/configure +++ b/codepot/configure @@ -3027,7 +3027,7 @@ cachedir=$cachedir -ac_config_files="$ac_config_files Makefile etc/Makefile etc/codepot.ini etc/codepot.a2ldap DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/websvn/cache/Makefile src/websvn/doc/Makefile src/websvn/include/Makefile src/websvn/languages/Makefile src/websvn/lib/geshi/Makefile src/websvn/lib/Makefile src/websvn/temp/Makefile src/websvn/templates/calm/images/Makefile src/websvn/templates/calm/star-light/smilies/Makefile src/websvn/templates/calm/star-light/src/Makefile src/websvn/templates/calm/star-light/Makefile src/websvn/templates/calm/Makefile src/websvn/templates/Makefile src/websvn/Makefile src/Makefile" +ac_config_files="$ac_config_files Makefile codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/websvn/cache/Makefile src/websvn/doc/Makefile src/websvn/include/Makefile src/websvn/languages/Makefile src/websvn/lib/geshi/Makefile src/websvn/lib/Makefile src/websvn/temp/Makefile src/websvn/templates/calm/images/Makefile src/websvn/templates/calm/star-light/smilies/Makefile src/websvn/templates/calm/star-light/src/Makefile src/websvn/templates/calm/star-light/Makefile src/websvn/templates/calm/Makefile src/websvn/templates/Makefile src/websvn/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3714,6 +3714,7 @@ do case $ac_config_target in "./config.h") CONFIG_HEADERS="$CONFIG_HEADERS ./config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "codepot.spec") CONFIG_FILES="$CONFIG_FILES codepot.spec" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/codepot.ini") CONFIG_FILES="$CONFIG_FILES etc/codepot.ini" ;; "etc/codepot.a2ldap") CONFIG_FILES="$CONFIG_FILES etc/codepot.a2ldap" ;; diff --git a/codepot/configure.ac b/codepot/configure.ac index 38f938e8..9ecf1145 100644 --- a/codepot/configure.ac +++ b/codepot/configure.ac @@ -81,6 +81,7 @@ AS_AC_EXPAND(CACHEDIR, $cachedir) AC_CONFIG_FILES([ Makefile + codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap diff --git a/codepot/src/codepot/config/lang_detect.php b/codepot/src/codepot/config/lang_detect.php index a324dba1..a96c699d 100644 --- a/codepot/src/codepot/config/lang_detect.php +++ b/codepot/src/codepot/config/lang_detect.php @@ -12,8 +12,8 @@ $config['lang_avail'] = array( 'en' => 'english', - 'ko' => 'korean', - 'id' => 'indonesian' + //'id' => 'indonesian', + 'ko' => 'korean' ); // define the default language code. This language MUST be supported! diff --git a/codepot/src/codepot/controllers/Makefile.am b/codepot/src/codepot/controllers/Makefile.am index 872b768c..10fc19e1 100644 --- a/codepot/src/codepot/controllers/Makefile.am +++ b/codepot/src/codepot/controllers/Makefile.am @@ -8,6 +8,7 @@ www_DATA = \ main.php \ project.php \ site.php \ + user.php \ wiki.php EXTRA_DIST = $(www_DATA) diff --git a/codepot/src/codepot/controllers/Makefile.in b/codepot/src/codepot/controllers/Makefile.in index 21ef24c1..a460aa3a 100644 --- a/codepot/src/codepot/controllers/Makefile.in +++ b/codepot/src/codepot/controllers/Makefile.in @@ -173,6 +173,7 @@ www_DATA = \ main.php \ project.php \ site.php \ + user.php \ wiki.php EXTRA_DIST = $(www_DATA) diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index d8301394..e69ce43e 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -9,7 +9,6 @@ class Site extends Controller var $VIEW_DELETE = 'site_delete'; var $VIEW_CATALOG = 'site_catalog'; var $VIEW_LOG = 'log'; - var $VIEW_USER_HOME = 'user_home'; function Site () { @@ -367,7 +366,34 @@ class Site extends Controller $this->load->library ('pagination'); $this->load->model ('LogModel', 'logs'); - + $this->load->model ('SiteModel', 'sites'); + + $site = $this->sites->get ($this->config->config['language']); + if ($site === FALSE) + { + $data['login'] = $login; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + return; + } + if ($site === NULL && CODEPOT_DEFAULT_SITE_LANGUAGE != '') + { + $site = $this->sites->get (CODEPOT_DEFAULT_SITE_LANGUAGE); + if ($site === FALSE) + { + $data['login'] = $login; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + return; + } + } + + if ($login['sysadmin?'] && + $this->input->post('purge_log') == 'yes') + { + $this->logs->purge (); + } + $num_log_entries = $this->logs->getNumEntries (); if ($num_log_entries === FALSE) { @@ -393,9 +419,9 @@ class Site extends Controller return; } - $this->pagination->initialize ($pagecfg); + $data['site'] = $site; $data['login'] = $login; $data['log_entries'] = $log_entries; $data['page_links'] = $this->pagination->create_links (); @@ -403,47 +429,6 @@ class Site extends Controller $this->load->view ($this->VIEW_LOG, $data); } - function userhome () - { - $login = $this->login->getUser (); - if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') - redirect ('main/signin'); - - $this->load->library ('IssueHelper', 'issuehelper'); - $this->lang->load ('issue', CODEPOT_LANG); - - $this->load->model ('ProjectModel', 'projects'); - $this->load->model ('IssueModel', 'issues'); - - if ($login['id'] == '') - { - redirect ('site/home'); - } - else - { - $projects = $this->projects->getMyProjects ($login['id']); - - $issues = $this->issues->getMyIssues ( - $login['id'], $this->issuehelper->_get_open_status_array($this->lang)); - if ($projects === FALSE || $issues === FALSE) - { - $data['login'] = $login; - $data['message'] = 'DATABASE ERROR'; - $this->load->view ($this->VIEW_ERROR, $data); - } - else - { - $data['login'] = $login; - $data['projects'] = $projects; - $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); - $data['issue_priority_array'] = $this->issuehelper->_get_priority_array($this->lang); - $this->load->view ($this->VIEW_USER_HOME, $data); - } - } - } - function wiki ($xlink) { $login = $this->login->getUser (); diff --git a/codepot/src/codepot/controllers/user.php b/codepot/src/codepot/controllers/user.php new file mode 100644 index 00000000..d902fb71 --- /dev/null +++ b/codepot/src/codepot/controllers/user.php @@ -0,0 +1,141 @@ +load->helper ('url'); + $this->load->helper ('form'); + $this->load->library ('Converter', 'converter'); + $this->load->model (CODEPOT_LOGIN_MODEL, 'login'); + + $this->load->library ('Language', 'lang'); + $this->lang->load ('common', CODEPOT_LANG); + } + + function index () + { + return $this->home (); + } + + function home () + { + $login = $this->login->getUser (); + if (CODEPOT_SIGNIN_COMPULSORY && $login['id'] == '') + redirect ('main/signin'); + + if ($login['id'] == '') + { + redirect ('site/home'); + return; + } + + $this->load->library ('IssueHelper', 'issuehelper'); + $this->lang->load ('issue', CODEPOT_LANG); + + $this->load->model ('ProjectModel', 'projects'); + $this->load->model ('IssueModel', 'issues'); + + $projects = $this->projects->getMyProjects ($login['id']); + + $issues = $this->issues->getMyIssues ( + $login['id'], $this->issuehelper->_get_open_status_array($this->lang)); + if ($projects === FALSE || $issues === FALSE) + { + $data['login'] = $login; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $data['login'] = $login; + $data['projects'] = $projects; + $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); + $data['issue_priority_array'] = $this->issuehelper->_get_priority_array($this->lang); + $this->load->view ($this->VIEW_HOME, $data); + } + } + + function log ($offset = 0) + { + $login = $this->login->getUser (); + + if ($login['id'] == '') + { + redirect ('site/home'); + return; + } + + $this->load->model ('ProjectModel', 'projects'); + $user->id = $login['id']; + + $myprojs = $this->projects->getMyProjects ($login['id']); + if ($myprojs === FALSE) + { + $data['login'] = $login; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else if ($myprojs === NULL) + { + $data['login'] = $login; + $data['message'] = 'NO PROJECTS'; + $this->load->view ($this->VIEW_ERROR, $data); + } + else + { + $this->load->library ('pagination'); + $this->load->model ('LogModel', 'logs'); + + $numprojs = count($myprojs); + for ($i = 0; $i < $numprojs; $i++) + $projids[$i] = $myprojs[$i]->id; + + $num_log_entries = $this->logs->getNumEntries ($projids); + if ($num_log_entries === FALSE) + { + $data['login'] = $login; + $data['project'] = $project; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + return; + } + + $pagecfg['base_url'] = site_url() . "/user/log/"; + $pagecfg['total_rows'] = $num_log_entries; + $pagecfg['per_page'] = CODEPOT_MAX_LOGS_PER_PAGE; + $pagecfg['uri_segment'] = 3; + $pagecfg['first_link'] = $this->lang->line('First'); + $pagecfg['last_link'] = $this->lang->line('Last'); + + $log_entries = $this->logs->getEntries ($offset, $pagecfg['per_page'], $projids); + if ($log_entries === FALSE) + { + $data['login'] = $login; + $data['project'] = $project; + $data['message'] = 'DATABASE ERROR'; + $this->load->view ($this->VIEW_ERROR, $data); + return; + } + + $this->pagination->initialize ($pagecfg); + + $data['user'] = $user; + $data['login'] = $login; + $data['log_entries'] = $log_entries; + $data['page_links'] = $this->pagination->create_links (); + + $this->load->view ($this->VIEW_LOG, $data); + } + } +} + +?> diff --git a/codepot/src/codepot/language/english/common_lang.php b/codepot/src/codepot/language/english/common_lang.php index 7e70a90e..f95220d2 100644 --- a/codepot/src/codepot/language/english/common_lang.php +++ b/codepot/src/codepot/language/english/common_lang.php @@ -36,6 +36,7 @@ $lang['Last'] = 'Last'; $lang['Last updated by'] = 'Last updated by'; $lang['Last updated on'] = 'Last updated on'; $lang['Latest projects'] = 'Latest projects'; +$lang['Log'] = 'Log'; $lang['MD5'] = 'MD5'; $lang['Member'] = 'Member'; $lang['Members'] = 'Members'; @@ -45,6 +46,7 @@ $lang['My projects'] = 'My projects'; $lang['Name'] = 'Name'; $lang['New'] = 'New'; $lang['OK'] = 'OK'; +$lang['Open issues'] = 'Open issues'; $lang['Other projects'] = 'Other projects'; $lang['Overview'] = 'Overview'; $lang['Owner'] = 'Owner'; @@ -53,6 +55,7 @@ $lang['Path'] = 'Path'; $lang['Priority'] = 'Priority'; $lang['Project'] = 'Project'; $lang['Projects'] = 'Projects'; +$lang['Purge'] = 'Purge'; $lang['Repository'] = 'Repository'; $lang['Revision'] = 'Revision'; $lang['Search'] = 'Search'; diff --git a/codepot/src/codepot/language/indonesian/common_lang.php b/codepot/src/codepot/language/indonesian/common_lang.php index 112d4d8d..34099dd4 100644 --- a/codepot/src/codepot/language/indonesian/common_lang.php +++ b/codepot/src/codepot/language/indonesian/common_lang.php @@ -36,6 +36,7 @@ $lang['Last'] = 'Terakhir'; $lang['Last updated by'] = 'Terakhir memperbaharui oleh'; $lang['Last updated on'] = 'Waktu memperbaharui terakhir'; $lang['Latest projects'] = 'Proyek terakhir'; +$lang['Log'] = 'Log'; $lang['MD5'] = 'MD5'; $lang['Member'] = 'Anggota'; $lang['Members'] = 'Anggota'; @@ -44,7 +45,8 @@ $lang['My issues'] = 'Issue saya'; $lang['My projects'] = 'Proyek saya'; $lang['Name'] = 'Nama'; $lang['New'] = 'Baru'; -$lang['OK projects'] = 'OK'; +$lang['OK'] = 'OK'; +$lang['Open issues'] = 'Open issues'; $lang['Other projects'] = 'Proyek lain'; $lang['Overview'] = 'Ringkasan'; $lang['Owner'] = 'Owner'; @@ -53,6 +55,7 @@ $lang['Path'] = 'Path'; $lang['Priority'] = 'Pirority'; $lang['Project'] = 'Proyek'; $lang['Projects'] = 'Proyek'; +$lang['Purge'] = 'Purge'; $lang['Repository'] = 'Repository'; $lang['Revision'] = 'Revisi'; $lang['Search'] = 'Search'; diff --git a/codepot/src/codepot/language/korean/common_lang.php b/codepot/src/codepot/language/korean/common_lang.php index 5768489e..8151711a 100644 --- a/codepot/src/codepot/language/korean/common_lang.php +++ b/codepot/src/codepot/language/korean/common_lang.php @@ -36,6 +36,7 @@ $lang['Last'] = '마지막'; $lang['Last updated by'] = '최종수정인'; $lang['Last updated on'] = '최종수정시간'; $lang['Latest projects'] = '최근 프로젝트'; +$lang['Log'] = '활동기록'; $lang['MD5'] = 'MD5'; $lang['Member'] = '구성원'; $lang['Members'] = '구성원'; @@ -45,6 +46,7 @@ $lang['My projects'] = '내 프로젝트'; $lang['Name'] = '이름'; $lang['New'] = '신규'; $lang['OK'] = '확인'; +$lang['Open issues'] = '미처리이슈'; $lang['Other projects'] = '다른 프로젝트'; $lang['Overview'] = '개요'; $lang['Owner'] = '담당자'; @@ -53,6 +55,7 @@ $lang['Path'] = '경로'; $lang['Priority'] = '중요도'; $lang['Project'] = '프로젝트'; $lang['Projects'] = '프로젝트'; +$lang['Purge'] = '정화하기'; $lang['Repository'] = '저장소'; $lang['Revision'] = '리비전'; $lang['Search'] = '찾기'; diff --git a/codepot/src/codepot/models/issuemodel.php b/codepot/src/codepot/models/issuemodel.php index a14f8be2..1b7a97ae 100644 --- a/codepot/src/codepot/models/issuemodel.php +++ b/codepot/src/codepot/models/issuemodel.php @@ -101,13 +101,7 @@ class IssueModel extends Model //$this->db->order_by ('id', 'desc'); if (is_array($filter)) { - $cond = ''; - foreach ($filter as $k => $v) - { - if ($cond != '') $cond .= ' OR '; - $cond .= "status = '{$k}'"; - } - if ($cond != '') $this->db->where ("($cond)"); + $this->db->where_in ('status', array_keys($filter)); } $query = $this->db->get ('issue'); diff --git a/codepot/src/codepot/models/logmodel.php b/codepot/src/codepot/models/logmodel.php index 26934273..33259466 100644 --- a/codepot/src/codepot/models/logmodel.php +++ b/codepot/src/codepot/models/logmodel.php @@ -15,7 +15,10 @@ class LogModel extends Model //$this->db->where ('type', 'code'); //$this->db->where ('action', 'commit'); - if ($projectid != '') $this->db->where ('projectid', $projectid); + if (is_array($projectid)) + $this->db->where_in ('projectid', $projectid); + else if ($projectid != '') + $this->db->where ('projectid', $projectid); //$num = $this->db->count_all ('log'); $this->db->select ('count(id) as count'); @@ -36,7 +39,11 @@ class LogModel extends Model //$this->db->where ('type', 'code'); //$this->db->where ('action', 'commit'); - if ($projectid != '') $this->db->where ('projectid', $projectid); + if (is_array($projectid)) + $this->db->where_in ('projectid', $projectid); + else if ($projectid != '') + $this->db->where ('projectid', $projectid); + $this->db->order_by ('createdon', 'desc'); $query = $this->db->get ('log', $limit, $offset); @@ -144,6 +151,28 @@ class LogModel extends Model return TRUE; } } + + function purge () + { + $this->db->trans_begin (); + + $now = time(); + $one_month_ago = $now - (24 * 60 * 60 * 30); + $this->db->where ('createdon <=', + date ("Y-m-d H:i:s", $one_month_ago)); + $this->db->delete ('log'); + + if ($this->db->trans_status() === FALSE) + { + $this->db->trans_rollback (); + return FALSE; + } + else + { + $this->db->trans_commit (); + return TRUE; + } + } } ?> diff --git a/codepot/src/codepot/views/code_blame.php b/codepot/src/codepot/views/code_blame.php index 753dd1ea..50d3db4f 100644 --- a/codepot/src/codepot/views/code_blame.php +++ b/codepot/src/codepot/views/code_blame.php @@ -28,8 +28,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index db09a27e..4d16ef24 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -28,8 +28,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/code_file.php b/codepot/src/codepot/views/code_file.php index b5bd537d..cd0be0f9 100644 --- a/codepot/src/codepot/views/code_file.php +++ b/codepot/src/codepot/views/code_file.php @@ -28,8 +28,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/code_folder.php b/codepot/src/codepot/views/code_folder.php index 230d4e18..ddfad37b 100644 --- a/codepot/src/codepot/views/code_folder.php +++ b/codepot/src/codepot/views/code_folder.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/code_history.php b/codepot/src/codepot/views/code_history.php index 616d6d86..7375aeb9 100644 --- a/codepot/src/codepot/views/code_history.php +++ b/codepot/src/codepot/views/code_history.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/code_revision.php b/codepot/src/codepot/views/code_revision.php index 366f617c..583729c0 100644 --- a/codepot/src/codepot/views/code_revision.php +++ b/codepot/src/codepot/views/code_revision.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'code', + + 'page' => array ( + 'type' => 'project', + 'id' => 'code', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/error.php b/codepot/src/codepot/views/error.php index 2d91aeca..1f48da63 100644 --- a/codepot/src/codepot/views/error.php +++ b/codepot/src/codepot/views/error.php @@ -20,16 +20,22 @@ load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => $site, - 'project' => $project, - 'pageid' => '', + + 'page' => array ( + 'type' => $pagetype, + 'id' => '', + $pagetype => $pageobj + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/file_delete.php b/codepot/src/codepot/views/file_delete.php index 08ca044d..c7327002 100644 --- a/codepot/src/codepot/views/file_delete.php +++ b/codepot/src/codepot/views/file_delete.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'file', + + 'page' => array ( + 'type' => 'project', + 'id' => 'file', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/file_edit.php b/codepot/src/codepot/views/file_edit.php index adfedcff..6ff08edb 100644 --- a/codepot/src/codepot/views/file_edit.php +++ b/codepot/src/codepot/views/file_edit.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'file', + + 'page' => array ( + 'type' => 'project', + 'id' => 'file', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 8da47d74..26d7088d 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'file', + + 'page' => array ( + 'type' => 'project', + 'id' => 'file', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("file/create/{$project->id}", $this->lang->line('New')) ) diff --git a/codepot/src/codepot/views/file_show.php b/codepot/src/codepot/views/file_show.php index 60cb3c58..a7ece412 100644 --- a/codepot/src/codepot/views/file_show.php +++ b/codepot/src/codepot/views/file_show.php @@ -36,8 +36,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'file', + + 'page' => array ( + 'type' => 'project', + 'id' => 'file', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("file/create/{$project->id}", $this->lang->line('New')), array ("file/update/{$project->id}/{$hexname}", $this->lang->line('Edit')), diff --git a/codepot/src/codepot/views/issue_delete.php b/codepot/src/codepot/views/issue_delete.php index 64ffffd3..538b56e4 100644 --- a/codepot/src/codepot/views/issue_delete.php +++ b/codepot/src/codepot/views/issue_delete.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'issue', + + 'page' => array ( + 'type' => 'project', + 'id' => 'issue', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/issue_edit.php b/codepot/src/codepot/views/issue_edit.php index 1b073e3a..6d9095d5 100644 --- a/codepot/src/codepot/views/issue_edit.php +++ b/codepot/src/codepot/views/issue_edit.php @@ -23,8 +23,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'issue', + + 'page' => array ( + 'type' => 'project', + 'id' => 'issue', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/issue_home.php b/codepot/src/codepot/views/issue_home.php index 43db656c..2af94bee 100644 --- a/codepot/src/codepot/views/issue_home.php +++ b/codepot/src/codepot/views/issue_home.php @@ -70,8 +70,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'issue', + + 'page' => array ( + 'type' => 'project', + 'id' => 'issue', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("issue/create/{$project->id}", $this->lang->line('New'), 'issue_home_new') ) diff --git a/codepot/src/codepot/views/issue_show.php b/codepot/src/codepot/views/issue_show.php index cb48868c..588dbf00 100644 --- a/codepot/src/codepot/views/issue_show.php +++ b/codepot/src/codepot/views/issue_show.php @@ -160,8 +160,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'issue', + + 'page' => array ( + 'type' => 'project', + 'id' => 'issue', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("issue/create/{$project->id}", $this->lang->line('New')), array ("issue/update/{$project->id}/{$hexid}", $this->lang->line('Edit')), diff --git a/codepot/src/codepot/views/log.php b/codepot/src/codepot/views/log.php index c924b423..ab997086 100644 --- a/codepot/src/codepot/views/log.php +++ b/codepot/src/codepot/views/log.php @@ -4,12 +4,49 @@ + + + + + + + + + + lang->line('Home'); if ($login['id'] != '') $caption .= "({$login['id']})"; ?> + + + <?=htmlspecialchars($caption)?> @@ -25,16 +62,56 @@ name; + } +} +else if (isset($user)) +{ + $pagetype = 'user'; + $pageid = ''; + $pageobj = $user; + $banner = NULL; +} +else +{ + $pagetype = ''; + $pageid = ''; + $pageobj = NULL; + $banner = NULL; +} $this->load->view ( 'projectbar', array ( - 'banner' => NULL, - 'site' => $site, - 'project' => $project, - 'pageid' => ((isset($project) && $project != NULL)? 'project': 'sitelog'), + 'banner' => $banner, + + 'page' => array ( + 'type' => $pagetype, + 'id' => $pageid, + $pagetype => $pageobj + ), + 'ctxmenuitems' => array () ) ); @@ -48,6 +125,24 @@ $this->load->view ( lang->line ('Change log') ?> + + + + + +
+

+ + Are you sure? +

+
+ +
+ lang->line('Purge') ?> +
+ + +
@@ -95,7 +190,6 @@ $this->load->view ( print ''; } - if ($log['type'] == 'code') { print '
'; diff --git a/codepot/src/codepot/views/login.php b/codepot/src/codepot/views/login.php index 8e944d81..5e00399f 100644 --- a/codepot/src/codepot/views/login.php +++ b/codepot/src/codepot/views/login.php @@ -29,9 +29,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'project' => NULL, - 'pageid' => '', + + 'page' => array ( + 'type' => 'login', + 'id' => '', + 'login' => NULL + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/project_catalog.php b/codepot/src/codepot/views/project_catalog.php index e1b2e956..9b2a7042 100644 --- a/codepot/src/codepot/views/project_catalog.php +++ b/codepot/src/codepot/views/project_catalog.php @@ -70,9 +70,12 @@ $this->load->view ( 'projectbar', array ( 'banner' => $this->lang->line('Projects'), - 'site' => NULL, - 'project' => NULL, - 'pageid' => '', + + 'page' => array ( + 'type' => '', + 'id' => '' + ), + 'ctxmenuitems' => array ( array ("project/create", $this->lang->line('New'), 'project_catalog_new') ) diff --git a/codepot/src/codepot/views/project_delete.php b/codepot/src/codepot/views/project_delete.php index 94effda2..e6cd1ad5 100644 --- a/codepot/src/codepot/views/project_delete.php +++ b/codepot/src/codepot/views/project_delete.php @@ -21,8 +21,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'project', + + 'page' => array ( + 'type' => 'project', + 'id' => 'project', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/project_edit.php b/codepot/src/codepot/views/project_edit.php index d8e43078..6b49657b 100644 --- a/codepot/src/codepot/views/project_edit.php +++ b/codepot/src/codepot/views/project_edit.php @@ -22,9 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => (($mode != 'create')? NULL: $this->lang->line('Projects')), - 'site' => NULL, - 'project' => (($mode != 'create')? $project: NULL), - 'pageid' => 'project', + + 'page' => array ( + 'type' => 'project', + 'id' => 'project', + 'project' => (($mode != 'create')? $project: NULL) + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index ea164940..368270ed 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -36,8 +36,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'project', + + 'page' => array ( + 'type' => 'project', + 'id' => 'project', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("project/update/{$project->id}", $this->lang->line('Edit')), array ("project/delete/{$project->id}", $this->lang->line('Delete')) diff --git a/codepot/src/codepot/views/projectbar.php b/codepot/src/codepot/views/projectbar.php index a7184240..22c6f196 100644 --- a/codepot/src/codepot/views/projectbar.php +++ b/codepot/src/codepot/views/projectbar.php @@ -1,16 +1,21 @@
"; + $type = $page['type']; + $id = $page['id']; + if (isset($banner)) { print htmlspecialchars($banner); } - else if (isset($project)) + else if ($type == 'project') { + $project = $page[$type]; + if ($project->name == '') print $project->id; else if (strcasecmp ($project->name, $project->id) == 0) @@ -18,10 +23,16 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems else print htmlspecialchars($project->name) . " ({$project->id})"; } - else if (isset($site) && $site->name != '') + else if ($type == 'site') { + $site = $page[$type]; print htmlspecialchars($site->name); } + else if ($type == 'user') + { + $user = $page[$type]; + print htmlspecialchars($user->id); + } else print htmlspecialchars(CODEPOT_DEFAULT_SITE_NAME); print "
"; @@ -40,7 +51,7 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems print '
'; - if (isset($project) && $pageid != '') + if ($type == 'project') { $menuitems = array ( array ("project/home/{$project->id}", $con->lang->line('Overview')), @@ -61,7 +72,7 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems foreach ($menuitems as $item) { $menuid = substr ($item[0], 0, strpos($item[0], '/')); - $extra = ($menuid == $pageid)? 'class="selected"': ''; + $extra = ($menuid == $id)? 'class="selected"': ''; $menulink = $item[0]; if ($menuid == 'code') @@ -73,16 +84,33 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems print anchor ($menulink, $item[1], $extra); } } - else if (isset($site) && $pageid != '') + else if ($type == 'site') { $menuitems = array ( - array ("site/catalog", $con->lang->line('Sites')) + array ("site/catalog", $con->lang->line('Sites')), + array ("site/log", $con->lang->line('Log')) ); foreach ($menuitems as $item) { - $menuid = substr ($item[0], 0, strpos($item[0], '/')); - $extra = ($menuid == $pageid)? 'class="selected"': ''; + $menuid = substr ($item[0], strpos($item[0], '/') + 1); + $extra = ($menuid == $id)? 'class="selected"': ''; + $menulink = $item[0]; + + print anchor ($menulink, $item[1], $extra); + } + } + else if ($type == 'user') + { + $menuitems = array ( + array ("user/home", $con->lang->line('Overview')), + array ("user/log", $con->lang->line('Log')) + ); + + foreach ($menuitems as $item) + { + $menuid = substr ($item[0], strpos($item[0], '/') + 1); + $extra = ($menuid == $id)? 'class="selected"': ''; $menulink = $item[0]; print anchor ($menulink, $item[1], $extra); @@ -94,7 +122,7 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems print '
'; } -show_projectbar ($this, $banner, $site, $project, $pageid, $ctxmenuitems); +show_projectbar ($this, $banner, $page, $ctxmenuitems); ?> diff --git a/codepot/src/codepot/views/site_catalog.php b/codepot/src/codepot/views/site_catalog.php index 1dee3f54..624fb32e 100644 --- a/codepot/src/codepot/views/site_catalog.php +++ b/codepot/src/codepot/views/site_catalog.php @@ -27,9 +27,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => $this->lang->line('Administration'), - 'site' => $site, - 'project' => NULL, - 'pageid' => 'site', + + 'page' => array ( + 'type' => 'site', + 'id' => 'catalog', + 'site' => $site, + ), + 'ctxmenuitems' => array ( array ('site/create', $this->lang->line('New')) ) diff --git a/codepot/src/codepot/views/site_delete.php b/codepot/src/codepot/views/site_delete.php index b32b043f..893794cc 100644 --- a/codepot/src/codepot/views/site_delete.php +++ b/codepot/src/codepot/views/site_delete.php @@ -21,9 +21,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => $this->lang->line('Administration'), - 'site' => $site, - 'project' => NULL, - 'pageid' => 'site', + + 'page' => array ( + 'type' => 'site', + 'id' => 'catalog', + 'site' => $site, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/site_edit.php b/codepot/src/codepot/views/site_edit.php index 29315847..68f888ea 100644 --- a/codepot/src/codepot/views/site_edit.php +++ b/codepot/src/codepot/views/site_edit.php @@ -22,9 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => $this->lang->line('Administration'), - 'site' => $site, - 'project' => NULL, - 'pageid' => 'site', + + 'page' => array ( + 'type' => 'site', + 'id' => 'catalog', + 'project' => $site, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/site_home.php b/codepot/src/codepot/views/site_home.php index 82d2de7a..9c086fa6 100644 --- a/codepot/src/codepot/views/site_home.php +++ b/codepot/src/codepot/views/site_home.php @@ -38,10 +38,14 @@ function render_wiki() $this->load->view ( 'projectbar', array ( - 'banner' => NULL, - 'project' => NULL, - 'site' => $site, - 'pageid' => '', + 'banner' => $site->name, + + 'page' => array ( + 'type' => ($login['sysadmin?']? 'site': ''), + 'id' => '', + 'site' => ($login['sysadmin?']? $site: NULL) + ), + 'ctxmenuitems' => NULL ) ); diff --git a/codepot/src/codepot/views/site_show.php b/codepot/src/codepot/views/site_show.php index 93c684fc..5b099dbe 100644 --- a/codepot/src/codepot/views/site_show.php +++ b/codepot/src/codepot/views/site_show.php @@ -47,9 +47,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => $this->lang->line('Administration'), - 'project' => NULL, - 'site' => $site, - 'pageid' => 'site', + + 'page' => array ( + 'type' => 'site', + 'id' => 'catalog', + 'site' => $site, + ), + 'ctxmenuitems' => $ctxmenuitems ) ); diff --git a/codepot/src/codepot/views/taskbar.php b/codepot/src/codepot/views/taskbar.php index c43a5ca3..e2f7c881 100644 --- a/codepot/src/codepot/views/taskbar.php +++ b/codepot/src/codepot/views/taskbar.php @@ -8,7 +8,7 @@ function show_taskbar ($con, $loginid, $issysadmin) if (isset($loginid) && $loginid != '') { - print anchor ('site/userhome', htmlspecialchars($loginid)); + print anchor ('user/home', htmlspecialchars($loginid)); $hex = $con->converter->AsciiToHex (current_url()); print anchor ("main/signout/{$hex}", $con->lang->line('Sign out')); diff --git a/codepot/src/codepot/views/user_home.php b/codepot/src/codepot/views/user_home.php index eb09404b..2072b20c 100644 --- a/codepot/src/codepot/views/user_home.php +++ b/codepot/src/codepot/views/user_home.php @@ -11,7 +11,7 @@ @@ -29,13 +29,19 @@ $(function () { id = $login['id']; + $this->load->view ( 'projectbar', array ( - 'banner' => $login['id'], - 'site' => NULL, - 'project' => NULL, - 'pageid' => '', + 'banner' => NULL, + + 'page' => array ( + 'type' => 'user', + 'id' => 'issues', + 'user' => $user, + ), + 'ctxmenuitems' => array () ) ); @@ -48,24 +54,17 @@ $this->load->view (
- - -
+

+ + lang->line('Projects')?> () + +

+
-
+

+ + lang->line('Open issues')?> () + +

+
    load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'wiki', + + 'page' => array ( + 'type' => 'project', + 'id' => 'wiki', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/wiki_edit.php b/codepot/src/codepot/views/wiki_edit.php index d0778700..d50d4f1e 100644 --- a/codepot/src/codepot/views/wiki_edit.php +++ b/codepot/src/codepot/views/wiki_edit.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'wiki', + + 'page' => array ( + 'type' => 'project', + 'id' => 'wiki', + 'project' => $project, + ), + 'ctxmenuitems' => array () ) ); diff --git a/codepot/src/codepot/views/wiki_home.php b/codepot/src/codepot/views/wiki_home.php index 38f8ca43..50b36737 100644 --- a/codepot/src/codepot/views/wiki_home.php +++ b/codepot/src/codepot/views/wiki_home.php @@ -22,8 +22,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'wiki', + + 'page' => array ( + 'type' => 'project', + 'id' => 'wiki', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("wiki/create/{$project->id}", $this->lang->line('New')) ) diff --git a/codepot/src/codepot/views/wiki_show.php b/codepot/src/codepot/views/wiki_show.php index b48d85be..631fb775 100644 --- a/codepot/src/codepot/views/wiki_show.php +++ b/codepot/src/codepot/views/wiki_show.php @@ -36,8 +36,13 @@ $this->load->view ( 'projectbar', array ( 'banner' => NULL, - 'site' => NULL, - 'pageid' => 'wiki', + + 'page' => array ( + 'type' => 'project', + 'id' => 'wiki', + 'project' => $project, + ), + 'ctxmenuitems' => array ( array ("wiki/create/{$project->id}", $this->lang->line('New')), array ("wiki/update/{$project->id}/{$hexname}", $this->lang->line('Edit')),