changed the way the projectbar view is used.
added the rpm spec file.
This commit is contained in:
		| @ -27,3 +27,12 @@ deb: dist-gzip | |||||||
| 	$(RM) -r "$(PACKAGE)-$(VERSION)" | 	$(RM) -r "$(PACKAGE)-$(VERSION)" | ||||||
| 	mv -f "/var/tmp/$(PACKAGE)-$(VERSION).deb" . | 	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@ | ||||||
|  | |||||||
| @ -33,9 +33,9 @@ PRE_UNINSTALL = : | |||||||
| POST_UNINSTALL = : | POST_UNINSTALL = : | ||||||
| subdir = . | subdir = . | ||||||
| DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ | ||||||
| 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \ | 	$(srcdir)/Makefile.in $(srcdir)/codepot.spec.in \ | ||||||
| 	$(top_srcdir)/configure ac/aux/install-sh ac/aux/missing \ | 	$(srcdir)/config.h.in $(top_srcdir)/configure \ | ||||||
| 	config.guess config.sub | 	ac/aux/install-sh ac/aux/missing config.guess config.sub | ||||||
| ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||||||
| am__aclocal_m4_deps = $(top_srcdir)/ac/m4/as-ac-expand.m4 \ | am__aclocal_m4_deps = $(top_srcdir)/ac/m4/as-ac-expand.m4 \ | ||||||
| 	$(top_srcdir)/configure.ac | 	$(top_srcdir)/configure.ac | ||||||
| @ -45,7 +45,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ | |||||||
|  configure.lineno config.status.lineno |  configure.lineno config.status.lineno | ||||||
| mkinstalldirs = $(install_sh) -d | mkinstalldirs = $(install_sh) -d | ||||||
| CONFIG_HEADER = config.h | CONFIG_HEADER = config.h | ||||||
| CONFIG_CLEAN_FILES = | CONFIG_CLEAN_FILES = codepot.spec | ||||||
| CONFIG_CLEAN_VPATH_FILES = | CONFIG_CLEAN_VPATH_FILES = | ||||||
| SOURCES = | SOURCES = | ||||||
| DIST_SOURCES = | DIST_SOURCES = | ||||||
| @ -254,6 +254,8 @@ $(srcdir)/config.h.in:  $(am__configure_deps) | |||||||
|  |  | ||||||
| distclean-hdr: | distclean-hdr: | ||||||
| 	-rm -f config.h stamp-h1 | 	-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 | # This directory's subdirectories are mostly independent; you can cd | ||||||
| # into them and run `make' without going through this Makefile. | # into them and run `make' without going through this Makefile. | ||||||
| @ -706,6 +708,16 @@ deb: dist-gzip | |||||||
| 	$(RM) -r "$(PACKAGE)-$(VERSION)" | 	$(RM) -r "$(PACKAGE)-$(VERSION)" | ||||||
| 	mv -f "/var/tmp/$(PACKAGE)-$(VERSION).deb" . | 	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. | # 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. | # Otherwise a system limit (for SysV at least) may be exceeded. | ||||||
| .NOEXPORT: | .NOEXPORT: | ||||||
|  | |||||||
							
								
								
									
										81
									
								
								codepot/codepot.spec.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								codepot/codepot.spec.in
									
									
									
									
									
										Normal file
									
								
							| @ -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 | ||||||
							
								
								
									
										3
									
								
								codepot/configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								codepot/configure
									
									
									
									
										vendored
									
									
								
							| @ -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 | cat >confcache <<\_ACEOF | ||||||
| # This file is a shell script that caches the results of configure | # This file is a shell script that caches the results of configure | ||||||
| @ -3714,6 +3714,7 @@ do | |||||||
|   case $ac_config_target in |   case $ac_config_target in | ||||||
|     "./config.h") CONFIG_HEADERS="$CONFIG_HEADERS ./config.h" ;; |     "./config.h") CONFIG_HEADERS="$CONFIG_HEADERS ./config.h" ;; | ||||||
|     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; |     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; | ||||||
|  |     "codepot.spec") CONFIG_FILES="$CONFIG_FILES codepot.spec" ;; | ||||||
|     "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; |     "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; | ||||||
|     "etc/codepot.ini") CONFIG_FILES="$CONFIG_FILES etc/codepot.ini" ;; |     "etc/codepot.ini") CONFIG_FILES="$CONFIG_FILES etc/codepot.ini" ;; | ||||||
|     "etc/codepot.a2ldap") CONFIG_FILES="$CONFIG_FILES etc/codepot.a2ldap" ;; |     "etc/codepot.a2ldap") CONFIG_FILES="$CONFIG_FILES etc/codepot.a2ldap" ;; | ||||||
|  | |||||||
| @ -81,6 +81,7 @@ AS_AC_EXPAND(CACHEDIR, $cachedir) | |||||||
|  |  | ||||||
| AC_CONFIG_FILES([ | AC_CONFIG_FILES([ | ||||||
| 	Makefile  | 	Makefile  | ||||||
|  | 	codepot.spec | ||||||
| 	etc/Makefile | 	etc/Makefile | ||||||
| 	etc/codepot.ini | 	etc/codepot.ini | ||||||
| 	etc/codepot.a2ldap | 	etc/codepot.a2ldap | ||||||
|  | |||||||
| @ -12,8 +12,8 @@ | |||||||
|  |  | ||||||
| $config['lang_avail'] = array( | $config['lang_avail'] = array( | ||||||
| 	'en'    => 'english', | 	'en'    => 'english', | ||||||
| 	'ko'    => 'korean', | 	//'id'    => 'indonesian', | ||||||
| 	'id'    => 'indonesian' | 	'ko'    => 'korean' | ||||||
| ); | ); | ||||||
|  |  | ||||||
| // define the default language code. This language MUST be supported! | // define the default language code. This language MUST be supported! | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ www_DATA =  \ | |||||||
| 	main.php \ | 	main.php \ | ||||||
| 	project.php \ | 	project.php \ | ||||||
| 	site.php \ | 	site.php \ | ||||||
|  | 	user.php \ | ||||||
| 	wiki.php | 	wiki.php | ||||||
|  |  | ||||||
| EXTRA_DIST = $(www_DATA) | EXTRA_DIST = $(www_DATA) | ||||||
|  | |||||||
| @ -173,6 +173,7 @@ www_DATA = \ | |||||||
| 	main.php \ | 	main.php \ | ||||||
| 	project.php \ | 	project.php \ | ||||||
| 	site.php \ | 	site.php \ | ||||||
|  | 	user.php \ | ||||||
| 	wiki.php | 	wiki.php | ||||||
|  |  | ||||||
| EXTRA_DIST = $(www_DATA) | EXTRA_DIST = $(www_DATA) | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ class Site extends Controller | |||||||
| 	var $VIEW_DELETE = 'site_delete'; | 	var $VIEW_DELETE = 'site_delete'; | ||||||
|         var $VIEW_CATALOG = 'site_catalog'; |         var $VIEW_CATALOG = 'site_catalog'; | ||||||
| 	var $VIEW_LOG = 'log'; | 	var $VIEW_LOG = 'log'; | ||||||
|         var $VIEW_USER_HOME = 'user_home'; |  | ||||||
|  |  | ||||||
| 	function Site () | 	function Site () | ||||||
| 	{ | 	{ | ||||||
| @ -367,7 +366,34 @@ class Site extends Controller | |||||||
|  |  | ||||||
| 		$this->load->library ('pagination'); | 		$this->load->library ('pagination'); | ||||||
| 		$this->load->model ('LogModel', 'logs'); | 		$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 (); | 		$num_log_entries = $this->logs->getNumEntries (); | ||||||
| 		if ($num_log_entries === FALSE) | 		if ($num_log_entries === FALSE) | ||||||
| 		{ | 		{ | ||||||
| @ -393,9 +419,9 @@ class Site extends Controller | |||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  |  | ||||||
| 		$this->pagination->initialize ($pagecfg); | 		$this->pagination->initialize ($pagecfg); | ||||||
|  |  | ||||||
|  | 		$data['site'] = $site; | ||||||
| 		$data['login'] = $login; | 		$data['login'] = $login; | ||||||
| 		$data['log_entries'] = $log_entries; | 		$data['log_entries'] = $log_entries; | ||||||
| 		$data['page_links'] = $this->pagination->create_links (); | 		$data['page_links'] = $this->pagination->create_links (); | ||||||
| @ -403,47 +429,6 @@ class Site extends Controller | |||||||
| 		$this->load->view ($this->VIEW_LOG, $data); | 		$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) | 	function wiki ($xlink) | ||||||
| 	{ | 	{ | ||||||
| 		$login = $this->login->getUser (); | 		$login = $this->login->getUser (); | ||||||
|  | |||||||
							
								
								
									
										141
									
								
								codepot/src/codepot/controllers/user.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								codepot/src/codepot/controllers/user.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,141 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  | class User extends Controller  | ||||||
|  | { | ||||||
|  | 	var $VIEW_ERROR = 'error'; | ||||||
|  | 	var $VIEW_LOG = 'log'; | ||||||
|  |         var $VIEW_HOME = 'user_home'; | ||||||
|  |  | ||||||
|  | 	function User () | ||||||
|  | 	{ | ||||||
|  | 		parent::Controller (); | ||||||
|  |  | ||||||
|  | 		$this->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); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | ?> | ||||||
| @ -36,6 +36,7 @@ $lang['Last'] = 'Last'; | |||||||
| $lang['Last updated by'] = 'Last updated by'; | $lang['Last updated by'] = 'Last updated by'; | ||||||
| $lang['Last updated on'] = 'Last updated on'; | $lang['Last updated on'] = 'Last updated on'; | ||||||
| $lang['Latest projects'] = 'Latest projects'; | $lang['Latest projects'] = 'Latest projects'; | ||||||
|  | $lang['Log'] = 'Log'; | ||||||
| $lang['MD5'] = 'MD5'; | $lang['MD5'] = 'MD5'; | ||||||
| $lang['Member'] = 'Member'; | $lang['Member'] = 'Member'; | ||||||
| $lang['Members'] = 'Members'; | $lang['Members'] = 'Members'; | ||||||
| @ -45,6 +46,7 @@ $lang['My projects'] = 'My projects'; | |||||||
| $lang['Name'] = 'Name'; | $lang['Name'] = 'Name'; | ||||||
| $lang['New'] = 'New'; | $lang['New'] = 'New'; | ||||||
| $lang['OK'] = 'OK'; | $lang['OK'] = 'OK'; | ||||||
|  | $lang['Open issues'] = 'Open issues'; | ||||||
| $lang['Other projects'] = 'Other projects'; | $lang['Other projects'] = 'Other projects'; | ||||||
| $lang['Overview'] = 'Overview'; | $lang['Overview'] = 'Overview'; | ||||||
| $lang['Owner'] = 'Owner'; | $lang['Owner'] = 'Owner'; | ||||||
| @ -53,6 +55,7 @@ $lang['Path'] = 'Path'; | |||||||
| $lang['Priority'] = 'Priority'; | $lang['Priority'] = 'Priority'; | ||||||
| $lang['Project'] = 'Project'; | $lang['Project'] = 'Project'; | ||||||
| $lang['Projects'] = 'Projects'; | $lang['Projects'] = 'Projects'; | ||||||
|  | $lang['Purge'] = 'Purge'; | ||||||
| $lang['Repository'] = 'Repository'; | $lang['Repository'] = 'Repository'; | ||||||
| $lang['Revision'] = 'Revision'; | $lang['Revision'] = 'Revision'; | ||||||
| $lang['Search'] = 'Search'; | $lang['Search'] = 'Search'; | ||||||
|  | |||||||
| @ -36,6 +36,7 @@ $lang['Last'] = 'Terakhir'; | |||||||
| $lang['Last updated by'] = 'Terakhir memperbaharui oleh'; | $lang['Last updated by'] = 'Terakhir memperbaharui oleh'; | ||||||
| $lang['Last updated on'] = 'Waktu memperbaharui terakhir'; | $lang['Last updated on'] = 'Waktu memperbaharui terakhir'; | ||||||
| $lang['Latest projects'] = 'Proyek terakhir'; | $lang['Latest projects'] = 'Proyek terakhir'; | ||||||
|  | $lang['Log'] = 'Log'; | ||||||
| $lang['MD5'] = 'MD5'; | $lang['MD5'] = 'MD5'; | ||||||
| $lang['Member'] = 'Anggota'; | $lang['Member'] = 'Anggota'; | ||||||
| $lang['Members'] = 'Anggota'; | $lang['Members'] = 'Anggota'; | ||||||
| @ -44,7 +45,8 @@ $lang['My issues'] = 'Issue saya'; | |||||||
| $lang['My projects'] = 'Proyek saya'; | $lang['My projects'] = 'Proyek saya'; | ||||||
| $lang['Name'] = 'Nama'; | $lang['Name'] = 'Nama'; | ||||||
| $lang['New'] = 'Baru'; | $lang['New'] = 'Baru'; | ||||||
| $lang['OK projects'] = 'OK'; | $lang['OK'] = 'OK'; | ||||||
|  | $lang['Open issues'] = 'Open issues'; | ||||||
| $lang['Other projects'] = 'Proyek lain'; | $lang['Other projects'] = 'Proyek lain'; | ||||||
| $lang['Overview'] = 'Ringkasan'; | $lang['Overview'] = 'Ringkasan'; | ||||||
| $lang['Owner'] = 'Owner'; | $lang['Owner'] = 'Owner'; | ||||||
| @ -53,6 +55,7 @@ $lang['Path'] = 'Path'; | |||||||
| $lang['Priority'] = 'Pirority'; | $lang['Priority'] = 'Pirority'; | ||||||
| $lang['Project'] = 'Proyek'; | $lang['Project'] = 'Proyek'; | ||||||
| $lang['Projects'] = 'Proyek'; | $lang['Projects'] = 'Proyek'; | ||||||
|  | $lang['Purge'] = 'Purge'; | ||||||
| $lang['Repository'] = 'Repository'; | $lang['Repository'] = 'Repository'; | ||||||
| $lang['Revision'] = 'Revisi'; | $lang['Revision'] = 'Revisi'; | ||||||
| $lang['Search'] = 'Search'; | $lang['Search'] = 'Search'; | ||||||
|  | |||||||
| @ -36,6 +36,7 @@ $lang['Last'] = '마지막'; | |||||||
| $lang['Last updated by'] = '최종수정인'; | $lang['Last updated by'] = '최종수정인'; | ||||||
| $lang['Last updated on'] = '최종수정시간'; | $lang['Last updated on'] = '최종수정시간'; | ||||||
| $lang['Latest projects'] = '최근 프로젝트'; | $lang['Latest projects'] = '최근 프로젝트'; | ||||||
|  | $lang['Log'] = '활동기록'; | ||||||
| $lang['MD5'] = 'MD5'; | $lang['MD5'] = 'MD5'; | ||||||
| $lang['Member'] = '구성원'; | $lang['Member'] = '구성원'; | ||||||
| $lang['Members'] = '구성원'; | $lang['Members'] = '구성원'; | ||||||
| @ -45,6 +46,7 @@ $lang['My projects'] = '내 프로젝트'; | |||||||
| $lang['Name'] = '이름'; | $lang['Name'] = '이름'; | ||||||
| $lang['New'] = '신규'; | $lang['New'] = '신규'; | ||||||
| $lang['OK'] = '확인'; | $lang['OK'] = '확인'; | ||||||
|  | $lang['Open issues'] = '미처리이슈'; | ||||||
| $lang['Other projects'] = '다른 프로젝트'; | $lang['Other projects'] = '다른 프로젝트'; | ||||||
| $lang['Overview'] = '개요'; | $lang['Overview'] = '개요'; | ||||||
| $lang['Owner'] = '담당자'; | $lang['Owner'] = '담당자'; | ||||||
| @ -53,6 +55,7 @@ $lang['Path'] = '경로'; | |||||||
| $lang['Priority'] = '중요도'; | $lang['Priority'] = '중요도'; | ||||||
| $lang['Project'] = '프로젝트'; | $lang['Project'] = '프로젝트'; | ||||||
| $lang['Projects'] = '프로젝트'; | $lang['Projects'] = '프로젝트'; | ||||||
|  | $lang['Purge'] = '정화하기'; | ||||||
| $lang['Repository'] = '저장소'; | $lang['Repository'] = '저장소'; | ||||||
| $lang['Revision'] = '리비전'; | $lang['Revision'] = '리비전'; | ||||||
| $lang['Search'] = '찾기'; | $lang['Search'] = '찾기'; | ||||||
|  | |||||||
| @ -101,13 +101,7 @@ class IssueModel extends Model | |||||||
| 		//$this->db->order_by ('id', 'desc'); | 		//$this->db->order_by ('id', 'desc'); | ||||||
| 		if (is_array($filter)) | 		if (is_array($filter)) | ||||||
| 		{ | 		{ | ||||||
| 			$cond = ''; | 			$this->db->where_in ('status', array_keys($filter)); | ||||||
| 			foreach ($filter as $k => $v) |  | ||||||
| 			{ |  | ||||||
| 				if ($cond != '') $cond .= ' OR '; |  | ||||||
| 				$cond .= "status = '{$k}'"; |  | ||||||
| 			} |  | ||||||
| 			if ($cond != '') $this->db->where ("($cond)"); |  | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		$query = $this->db->get ('issue'); | 		$query = $this->db->get ('issue'); | ||||||
|  | |||||||
| @ -15,7 +15,10 @@ class LogModel extends Model | |||||||
| 		//$this->db->where ('type', 'code'); | 		//$this->db->where ('type', 'code'); | ||||||
| 		//$this->db->where ('action', 'commit'); | 		//$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'); | 		//$num = $this->db->count_all ('log'); | ||||||
|  |  | ||||||
| 		$this->db->select ('count(id) as count'); | 		$this->db->select ('count(id) as count'); | ||||||
| @ -36,7 +39,11 @@ class LogModel extends Model | |||||||
|  |  | ||||||
| 		//$this->db->where ('type', 'code'); | 		//$this->db->where ('type', 'code'); | ||||||
| 		//$this->db->where ('action', 'commit'); | 		//$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'); | 		$this->db->order_by ('createdon', 'desc'); | ||||||
| 		$query = $this->db->get ('log', $limit, $offset); | 		$query = $this->db->get ('log', $limit, $offset); | ||||||
|  |  | ||||||
| @ -144,6 +151,28 @@ class LogModel extends Model | |||||||
| 			return TRUE; | 			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; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| ?> | ?> | ||||||
|  | |||||||
| @ -28,8 +28,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -28,8 +28,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -28,8 +28,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'code', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'code', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -20,16 +20,22 @@ | |||||||
| <!----------------------------------------------------------------------------> | <!----------------------------------------------------------------------------> | ||||||
|  |  | ||||||
| <?php | <?php | ||||||
| if (!isset($project))  $project = NULL; | if (isset($project)) { $pagetype = 'project';  $pageobj = $project; } | ||||||
| if (!isset($site))  $site = NULL; | else if (isset($site)) { $pagetype = 'site'; $pageobj = $site; } | ||||||
|  | else if (isset($user)) { $pagetype = 'user'; $pageobj = $user; } | ||||||
|  | else { $pagetype = ''; $pageobj = NULL; } | ||||||
|  |  | ||||||
| $this->load->view ( | $this->load->view ( | ||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
|                 'site' => $site, | 		 | ||||||
|                 'project' => $project, | 		'page' => array ( | ||||||
|                 'pageid' => '', | 			'type' => $pagetype, | ||||||
|  | 			'id' => '', | ||||||
|  | 			$pagetype => $pageobj | ||||||
|  | 		), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array () |                 'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'file', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'file', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'file', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'file', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'file', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'file', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("file/create/{$project->id}", $this->lang->line('New'))  | 			array ("file/create/{$project->id}", $this->lang->line('New'))  | ||||||
| 		) | 		) | ||||||
|  | |||||||
| @ -36,8 +36,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'file', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'file', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("file/create/{$project->id}", $this->lang->line('New')), | 			array ("file/create/{$project->id}", $this->lang->line('New')), | ||||||
| 			array ("file/update/{$project->id}/{$hexname}", $this->lang->line('Edit')), | 			array ("file/update/{$project->id}/{$hexname}", $this->lang->line('Edit')), | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
|                 'pageid' => 'issue', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'issue', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array () |                 'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -23,8 +23,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'issue', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'issue', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -70,8 +70,13 @@ $this->load->view ( | |||||||
| 	'projectbar',  | 	'projectbar',  | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'issue', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'issue', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("issue/create/{$project->id}", $this->lang->line('New'), 'issue_home_new') | 			array ("issue/create/{$project->id}", $this->lang->line('New'), 'issue_home_new') | ||||||
| 		) | 		) | ||||||
|  | |||||||
| @ -160,8 +160,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'issue', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'issue', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("issue/create/{$project->id}", $this->lang->line('New')), | 			array ("issue/create/{$project->id}", $this->lang->line('New')), | ||||||
| 			array ("issue/update/{$project->id}/{$hexid}", $this->lang->line('Edit')), | 			array ("issue/update/{$project->id}/{$hexid}", $this->lang->line('Edit')), | ||||||
|  | |||||||
| @ -4,12 +4,49 @@ | |||||||
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||||||
| <link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" /> | <link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/common.css" /> | ||||||
| <link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/project.css" /> | <link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/project.css" /> | ||||||
|  |  | ||||||
|  | <?php if ($login['sysadmin?'] && isset($site)): ?> | ||||||
|  |  | ||||||
|  | <script type="text/javascript" src="<?=base_url()?>/js/jquery.min.js"></script> | ||||||
|  | <script type="text/javascript" src="<?=base_url()?>/js/jquery-ui.min.js"></script> | ||||||
|  | <link type="text/css" rel="stylesheet" href="<?=base_url()?>/css/jquery-ui.css" /> | ||||||
|  |  | ||||||
|  | <script type="text/javascript"> | ||||||
|  | $(function () { | ||||||
|  | 	$("#purge_confirm").dialog({ | ||||||
|  | 		resizable: false, | ||||||
|  | 		autoOpen: false, | ||||||
|  | 		height:140, | ||||||
|  | 		modal: true, | ||||||
|  | 		buttons: { | ||||||
|  | 			'<?=$this->lang->line('OK')?>': function() { | ||||||
|  | 				$(this).dialog('close'); | ||||||
|  | 				$('#purge_log').val ('yes'); | ||||||
|  | 				$('#purge_form').submit(); | ||||||
|  | 			}, | ||||||
|  | 			'<?=$this->lang->line('Cancel')?>': function() { | ||||||
|  | 				$(this).dialog('close'); | ||||||
|  | 				$('#purge_log').val ('no'); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	}); | ||||||
|  |         $("#log_mainarea_purge").button().click( | ||||||
|  | 		function () { | ||||||
|  | 			$('#purge_confirm').dialog('open');	 | ||||||
|  | 		} | ||||||
|  | 	); | ||||||
|  | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | <?php endif; ?> | ||||||
|  |  | ||||||
| <?php | <?php | ||||||
| 	$caption = $this->lang->line('Home'); | 	$caption = $this->lang->line('Home'); | ||||||
| 	if ($login['id'] != '') $caption .= "({$login['id']})"; | 	if ($login['id'] != '') $caption .= "({$login['id']})"; | ||||||
| ?> | ?> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <title><?=htmlspecialchars($caption)?></title> | <title><?=htmlspecialchars($caption)?></title> | ||||||
| </head> | </head> | ||||||
|  |  | ||||||
| @ -25,16 +62,56 @@ | |||||||
|  |  | ||||||
| <?php | <?php | ||||||
|  |  | ||||||
| if (!isset($project))  $project = NULL; | if (isset($project))  | ||||||
| if (!isset($site))  $site = NULL; | {  | ||||||
|  | 	$pagetype = 'project'; | ||||||
|  | 	$pageid = '';  | ||||||
|  | 	$pageobj = $project;  | ||||||
|  | 	$banner = NULL; | ||||||
|  | } | ||||||
|  | else if (isset($site))  | ||||||
|  | {  | ||||||
|  | 	if ($login['sysadmin?']) | ||||||
|  | 	{ | ||||||
|  | 		$pagetype = 'site'; | ||||||
|  | 		$pageid = 'log'; | ||||||
|  | 		$pageobj = $site;  | ||||||
|  | 		$banner = NULL; | ||||||
|  | 	} | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		$pagetype = ''; | ||||||
|  | 		$pageid = ''; | ||||||
|  | 		$pageobj = NULL; | ||||||
|  | 		$banner = $site->name; | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | else if (isset($user))  | ||||||
|  | {  | ||||||
|  | 	$pagetype = 'user'; | ||||||
|  | 	$pageid = '';  | ||||||
|  | 	$pageobj = $user;  | ||||||
|  | 	$banner = NULL; | ||||||
|  | } | ||||||
|  | else  | ||||||
|  | {  | ||||||
|  | 	$pagetype = ''; | ||||||
|  | 	$pageid = ''; | ||||||
|  | 	$pageobj = NULL;  | ||||||
|  | 	$banner = NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
| $this->load->view ( | $this->load->view ( | ||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => NULL, | 		'banner' => $banner, | ||||||
| 		'site' => $site, |  | ||||||
| 		'project' => $project, | 		'page' => array ( | ||||||
| 		'pageid' => ((isset($project) && $project != NULL)? 'project': 'sitelog'), | 			'type' => $pagetype, | ||||||
|  | 			'id' => $pageid, | ||||||
|  | 			$pagetype => $pageobj	 | ||||||
|  | 		), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array () |                 'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
| @ -48,6 +125,24 @@ $this->load->view ( | |||||||
| <?= $this->lang->line ('Change log') ?> | <?= $this->lang->line ('Change log') ?> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | <?php if ($login['sysadmin?'] && isset($site)): ?> | ||||||
|  | 	<?=form_open("site/log", 'id="purge_form"')?> | ||||||
|  | 		<input type='hidden' name='purge_log' id='purge_log' value='' /> | ||||||
|  | 	<?=form_close()?> | ||||||
|  |  | ||||||
|  | 	<div id="purge_confirm" title="<?= $this->lang->line('Purge') ?>"> | ||||||
|  | 	<p> | ||||||
|  | 		<span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span> | ||||||
|  | 		Are you sure? | ||||||
|  | 	</p> | ||||||
|  | 	</div> | ||||||
|  |  | ||||||
|  | 	<div class="infostrip"> | ||||||
|  | 	<a id="log_mainarea_purge" href="#"><?= $this->lang->line('Purge') ?></a> | ||||||
|  | 	</div> | ||||||
|  |  | ||||||
|  | <?php endif; ?> | ||||||
|  |  | ||||||
| <div id="log_mainarea_result"> | <div id="log_mainarea_result"> | ||||||
|  |  | ||||||
| <table id="log_mainarea_result_table"> | <table id="log_mainarea_result_table"> | ||||||
| @ -95,7 +190,6 @@ $this->load->view ( | |||||||
| 			print '</td>'; | 			print '</td>'; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  |  | ||||||
| 		if ($log['type'] == 'code') | 		if ($log['type'] == 'code') | ||||||
| 		{ | 		{ | ||||||
| 			print '<td class="object">'; | 			print '<td class="object">'; | ||||||
|  | |||||||
| @ -29,9 +29,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL,	 | 		'banner' => NULL,	 | ||||||
| 		'site' => NULL, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => '', | 			'type' => 'login', | ||||||
|  | 			'id' => '', | ||||||
|  | 			'login' => NULL | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -70,9 +70,12 @@ $this->load->view ( | |||||||
| 	'projectbar',  | 	'projectbar',  | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => $this->lang->line('Projects'), | 		'banner' => $this->lang->line('Projects'), | ||||||
| 		'site' => NULL, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => '', | 			'type' => '', | ||||||
|  | 			'id' => '' | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("project/create", $this->lang->line('New'), 'project_catalog_new') | 			array ("project/create", $this->lang->line('New'), 'project_catalog_new') | ||||||
| 		) | 		) | ||||||
|  | |||||||
| @ -21,8 +21,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'project', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'project', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,9 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => (($mode != 'create')? NULL: $this->lang->line('Projects')), | 		'banner' => (($mode != 'create')? NULL: $this->lang->line('Projects')), | ||||||
| 		'site' => NULL, |  | ||||||
| 		'project' => (($mode != 'create')? $project: NULL), | 		'page' => array ( | ||||||
| 		'pageid' => 'project', | 			'type' => 'project', | ||||||
|  | 			'id' => 'project', | ||||||
|  | 			'project' => (($mode != 'create')? $project: NULL) | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -36,8 +36,13 @@ $this->load->view ( | |||||||
| 	'projectbar',  | 	'projectbar',  | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'project', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'project', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("project/update/{$project->id}", $this->lang->line('Edit')), | 			array ("project/update/{$project->id}", $this->lang->line('Edit')), | ||||||
| 			array ("project/delete/{$project->id}", $this->lang->line('Delete')) | 			array ("project/delete/{$project->id}", $this->lang->line('Delete')) | ||||||
|  | |||||||
| @ -1,16 +1,21 @@ | |||||||
| <div class="projectbar"> | <div class="projectbar"> | ||||||
|  |  | ||||||
| <?php | <?php | ||||||
| function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems) | function show_projectbar ($con, $banner, $page, $ctxmenuitems) | ||||||
| { | { | ||||||
| 	print "<div class='title'>"; | 	print "<div class='title'>"; | ||||||
|  |  | ||||||
|  | 	$type = $page['type']; | ||||||
|  | 	$id = $page['id']; | ||||||
|  |  | ||||||
| 	if (isset($banner)) | 	if (isset($banner)) | ||||||
| 	{ | 	{ | ||||||
| 		print htmlspecialchars($banner); | 		print htmlspecialchars($banner); | ||||||
| 	} | 	} | ||||||
| 	else if (isset($project))  | 	else if ($type == 'project') | ||||||
| 	{ | 	{ | ||||||
|  | 		$project = $page[$type]; | ||||||
|  |  | ||||||
| 		if ($project->name == '') | 		if ($project->name == '') | ||||||
| 			print $project->id; | 			print $project->id; | ||||||
| 		else if (strcasecmp ($project->name, $project->id) == 0) | 		else if (strcasecmp ($project->name, $project->id) == 0) | ||||||
| @ -18,10 +23,16 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems | |||||||
| 		else | 		else | ||||||
| 			print htmlspecialchars($project->name) . " ({$project->id})"; | 			print htmlspecialchars($project->name) . " ({$project->id})"; | ||||||
| 	} | 	} | ||||||
| 	else if (isset($site) && $site->name != '')  | 	else if ($type == 'site') | ||||||
| 	{ | 	{ | ||||||
|  | 		$site = $page[$type]; | ||||||
| 		print htmlspecialchars($site->name); | 		print htmlspecialchars($site->name); | ||||||
| 	} | 	} | ||||||
|  | 	else if ($type == 'user') | ||||||
|  | 	{ | ||||||
|  | 		$user = $page[$type]; | ||||||
|  | 		print htmlspecialchars($user->id); | ||||||
|  | 	} | ||||||
| 	else print htmlspecialchars(CODEPOT_DEFAULT_SITE_NAME); | 	else print htmlspecialchars(CODEPOT_DEFAULT_SITE_NAME); | ||||||
|  |  | ||||||
| 	print "</div>"; | 	print "</div>"; | ||||||
| @ -40,7 +51,7 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems | |||||||
|  |  | ||||||
| 	print '<div class="fixedmenu">'; | 	print '<div class="fixedmenu">'; | ||||||
|  |  | ||||||
| 	if (isset($project) && $pageid != '') | 	if ($type == 'project') | ||||||
| 	{ | 	{ | ||||||
| 		$menuitems = array ( | 		$menuitems = array ( | ||||||
| 			array ("project/home/{$project->id}", $con->lang->line('Overview')), | 			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) | 		foreach ($menuitems as $item) | ||||||
| 		{ | 		{ | ||||||
| 			$menuid = substr ($item[0], 0, strpos($item[0], '/')); | 			$menuid = substr ($item[0], 0, strpos($item[0], '/')); | ||||||
| 			$extra = ($menuid == $pageid)? 'class="selected"': ''; | 			$extra = ($menuid == $id)? 'class="selected"': ''; | ||||||
| 			$menulink = $item[0]; | 			$menulink = $item[0]; | ||||||
|  |  | ||||||
| 			if ($menuid == 'code') | 			if ($menuid == 'code') | ||||||
| @ -73,16 +84,33 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems | |||||||
| 			print anchor ($menulink, $item[1], $extra); | 			print anchor ($menulink, $item[1], $extra); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	else if (isset($site) && $pageid != '') | 	else if ($type == 'site') | ||||||
| 	{ | 	{ | ||||||
| 		$menuitems = array ( | 		$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) | 		foreach ($menuitems as $item) | ||||||
| 		{ | 		{ | ||||||
| 			$menuid = substr ($item[0], 0, strpos($item[0], '/')); | 			$menuid = substr ($item[0], strpos($item[0], '/') + 1); | ||||||
| 			$extra = ($menuid == $pageid)? 'class="selected"': ''; | 			$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]; | 			$menulink = $item[0]; | ||||||
|  |  | ||||||
| 			print anchor ($menulink, $item[1], $extra); | 			print anchor ($menulink, $item[1], $extra); | ||||||
| @ -94,7 +122,7 @@ function show_projectbar ($con, $banner, $site, $project, $pageid, $ctxmenuitems | |||||||
| 	print '</div>'; | 	print '</div>'; | ||||||
| } | } | ||||||
|  |  | ||||||
| show_projectbar ($this, $banner, $site, $project, $pageid, $ctxmenuitems); | show_projectbar ($this, $banner, $page, $ctxmenuitems); | ||||||
| ?> | ?> | ||||||
|  |  | ||||||
| </div> | </div> | ||||||
|  | |||||||
| @ -27,9 +27,13 @@ $this->load->view ( | |||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => $this->lang->line('Administration'), | 		'banner' => $this->lang->line('Administration'), | ||||||
| 		'site' => $site, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => 'site', | 			'type' => 'site', | ||||||
|  | 			'id' => 'catalog', | ||||||
|  | 			'site' => $site, | ||||||
|  |                 ), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array ( |                 'ctxmenuitems' => array ( | ||||||
| 			array ('site/create', $this->lang->line('New')) | 			array ('site/create', $this->lang->line('New')) | ||||||
| 		) | 		) | ||||||
|  | |||||||
| @ -21,9 +21,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => $this->lang->line('Administration'), | 		'banner' => $this->lang->line('Administration'), | ||||||
| 		'site' => $site, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => 'site', | 			'type' => 'site', | ||||||
|  | 			'id' => 'catalog', | ||||||
|  | 			'site' => $site, | ||||||
|  |                 ), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,9 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => $this->lang->line('Administration'), | 		'banner' => $this->lang->line('Administration'), | ||||||
| 		'site' => $site, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => 'site', | 			'type' => 'site', | ||||||
|  | 			'id' => 'catalog', | ||||||
|  | 			'project' => $site, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -38,10 +38,14 @@ function render_wiki() | |||||||
| $this->load->view ( | $this->load->view ( | ||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => NULL, | 		'banner' => $site->name, | ||||||
| 		'project' => NULL, |  | ||||||
| 		'site' => $site, | 		'page' => array ( | ||||||
| 		'pageid' => '', | 			'type' => ($login['sysadmin?']? 'site': ''), | ||||||
|  | 			'id' => '', | ||||||
|  | 			'site' => ($login['sysadmin?']? $site: NULL) | ||||||
|  |                 ), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => NULL |                 'ctxmenuitems' => NULL | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -47,9 +47,13 @@ $this->load->view ( | |||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => $this->lang->line('Administration'), | 		'banner' => $this->lang->line('Administration'), | ||||||
| 		'project' => NULL, |  | ||||||
| 		'site' => $site, | 		'page' => array ( | ||||||
| 		'pageid' => 'site', | 			'type' => 'site', | ||||||
|  | 			'id' => 'catalog', | ||||||
|  | 			'site' => $site, | ||||||
|  |                 ), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => $ctxmenuitems |                 'ctxmenuitems' => $ctxmenuitems | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ function show_taskbar ($con, $loginid, $issysadmin) | |||||||
|  |  | ||||||
| 	if (isset($loginid) && $loginid != '') | 	if (isset($loginid) && $loginid != '') | ||||||
| 	{ | 	{ | ||||||
| 		print anchor ('site/userhome', htmlspecialchars($loginid)); | 		print anchor ('user/home', htmlspecialchars($loginid)); | ||||||
|  |  | ||||||
| 		$hex = $con->converter->AsciiToHex (current_url()); | 		$hex = $con->converter->AsciiToHex (current_url()); | ||||||
| 		print anchor ("main/signout/{$hex}", $con->lang->line('Sign out')); | 		print anchor ("main/signout/{$hex}", $con->lang->line('Sign out')); | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ | |||||||
|  |  | ||||||
| <script type="text/javascript"> | <script type="text/javascript"> | ||||||
| $(function () { | $(function () { | ||||||
| 	$('#user_home_mainarea_result').tabs(); | 	$('#user_home_mainarea_result').accordion(); | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| @ -29,13 +29,19 @@ $(function () { | |||||||
| <!----------------------------------------------------------------------------> | <!----------------------------------------------------------------------------> | ||||||
|  |  | ||||||
| <?php | <?php | ||||||
|  | $user->id = $login['id']; | ||||||
|  |  | ||||||
| $this->load->view ( | $this->load->view ( | ||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => $login['id'], | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'project' => NULL, | 		'page' => array ( | ||||||
| 		'pageid' => '', | 			'type' => 'user', | ||||||
|  | 			'id' => 'issues', | ||||||
|  | 			'user' => $user, | ||||||
|  | 		), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array () |                 'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
| @ -48,24 +54,17 @@ $this->load->view ( | |||||||
| <?php | <?php | ||||||
| $num_projects = count($projects); | $num_projects = count($projects); | ||||||
| $num_issues = count($issues); | $num_issues = count($issues); | ||||||
|  | $num_activities = 0; | ||||||
| ?> | ?> | ||||||
|  |  | ||||||
| <div id="user_home_mainarea_result"> | <div id="user_home_mainarea_result"> | ||||||
|  |  | ||||||
| <ul> | <h3> | ||||||
| 	<li> | 	<a href='#user_home_mainarea_result_projects'> | ||||||
| 		<a href='#user_home_mainarea_result_my_projects'> | 		<?=$this->lang->line('Projects')?> (<?=$num_projects?>) | ||||||
| 			<?=$this->lang->line('My projects')?> (<?=$num_projects?>) | 	</a> | ||||||
| 		</a> | </h3> | ||||||
| 	</li> | <div id="user_home_mainarea_result_projects"> | ||||||
| 	<li> |  | ||||||
| 		<a href='#user_home_mainarea_result_my_issues'> |  | ||||||
| 			<?=$this->lang->line('My issues')?> (<?=$num_issues?>) |  | ||||||
| 		</a> |  | ||||||
| 	</li> |  | ||||||
| </ul> |  | ||||||
|  |  | ||||||
| <div id="user_home_mainarea_result_my_projects"> |  | ||||||
| <ul> | <ul> | ||||||
| <?php  | <?php  | ||||||
| foreach ($projects as $project)  | foreach ($projects as $project)  | ||||||
| @ -79,7 +78,12 @@ foreach ($projects as $project) | |||||||
| </ul> | </ul> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <div id="user_home_mainarea_result_my_issues"> | <h3> | ||||||
|  | 	<a href='#user_home_mainarea_result_issues'> | ||||||
|  | 		<?=$this->lang->line('Open issues')?> (<?=$num_issues?>) | ||||||
|  | 	</a> | ||||||
|  | </h3> | ||||||
|  | <div id="user_home_mainarea_result_issues"> | ||||||
| <ul> | <ul> | ||||||
| <?php  | <?php  | ||||||
| foreach ($issues as $issue)  | foreach ($issues as $issue)  | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
|         'projectbar', |         'projectbar', | ||||||
|         array ( |         array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
|                 'pageid' => 'wiki', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'wiki', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
|                 'ctxmenuitems' => array () |                 'ctxmenuitems' => array () | ||||||
|         ) |         ) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'wiki', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'wiki', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array () | 		'ctxmenuitems' => array () | ||||||
| 	) | 	) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -22,8 +22,13 @@ $this->load->view ( | |||||||
| 	'projectbar',  | 	'projectbar',  | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'wiki', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'wiki', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("wiki/create/{$project->id}", $this->lang->line('New'))  | 			array ("wiki/create/{$project->id}", $this->lang->line('New'))  | ||||||
| 		) | 		) | ||||||
|  | |||||||
| @ -36,8 +36,13 @@ $this->load->view ( | |||||||
| 	'projectbar', | 	'projectbar', | ||||||
| 	array ( | 	array ( | ||||||
| 		'banner' => NULL, | 		'banner' => NULL, | ||||||
| 		'site' => NULL, |  | ||||||
| 		'pageid' => 'wiki', | 		'page' => array ( | ||||||
|  | 			'type' => 'project', | ||||||
|  | 			'id' => 'wiki', | ||||||
|  | 			'project' => $project, | ||||||
|  | 		), | ||||||
|  |  | ||||||
| 		'ctxmenuitems' => array ( | 		'ctxmenuitems' => array ( | ||||||
| 			array ("wiki/create/{$project->id}", $this->lang->line('New')), | 			array ("wiki/create/{$project->id}", $this->lang->line('New')), | ||||||
| 			array ("wiki/update/{$project->id}/{$hexname}", $this->lang->line('Edit')), | 			array ("wiki/update/{$project->id}/{$hexname}", $this->lang->line('Edit')), | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user