Compare commits
	
		
			62 Commits
		
	
	
		
			v1.1.2
			...
			feature.is
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9bcb5f9456 | ||
| 
						 | 
					f412099f69 | ||
| 
						 | 
					0aa5999bb3 | ||
| 
						 | 
					16dda0743c | ||
| 
						 | 
					bcba64b2a1 | ||
| 
						 | 
					e40d922eef | ||
| 
						 | 
					7e226b43d3 | ||
| 
						 | 
					9171bfd1ab | ||
| 
						 | 
					be4774c95c | ||
| 
						 | 
					9644784a79 | ||
| 
						 | 
					1940d5c0b5 | ||
| 
						 | 
					7c7e3cd1f1 | ||
| 
						 | 
					3e2f95a152 | ||
| 
						 | 
					92de88ba13 | ||
| 
						 | 
					02d0f0923e | ||
| 
						 | 
					765a86ba90 | ||
| 
						 | 
					34309e34c3 | ||
| 
						 | 
					2176d1cde2 | ||
| 
						 | 
					45d53e8d21 | ||
| 
						 | 
					b36b8e3afb | ||
| 
						 | 
					801af66a4e | ||
| 
						 | 
					df6ffdf420 | ||
| 
						 | 
					b3368071ac | ||
| 
						 | 
					67b80ee11c | ||
| 
						 | 
					dc31155de1 | ||
| 
						 | 
					0bae69908b | ||
| 
						 | 
					47a077bc82 | ||
| 
						 | 
					836ff71364 | ||
| 
						 | 
					0afa07b2bd | ||
| 
						 | 
					4ee3d471fe | ||
| 
						 | 
					29c7fed81b | ||
| 
						 | 
					fb62061e5a | ||
| 
						 | 
					9b92b7139f | ||
| 
						 | 
					5ea4b02205 | ||
| 
						 | 
					12d3eef3d1 | ||
| 
						 | 
					576c06ffaf | ||
| 
						 | 
					352dc3e179 | ||
| 
						 | 
					aa164936f4 | ||
| 
						 | 
					9a93acd1a5 | ||
| 
						 | 
					587aa11cda | ||
| 
						 | 
					d04ecd60c4 | ||
| 
						 | 
					ecef510f78 | ||
| 
						 | 
					4976c20935 | ||
| 
						 | 
					5553c37ccd | ||
| 
						 | 
					aa68fe3485 | ||
| 
						 | 
					e408fe8733 | ||
| 
						 | 
					836986462a | ||
| 
						 | 
					51c6cdb20d | ||
| 
						 | 
					766232f29b | ||
| 
						 | 
					2ed021f30b | ||
| 
						 | 
					899fe561df | ||
| 
						 | 
					1d89cec2cf | ||
| 
						 | 
					39ba5b37ef | ||
| 
						 | 
					002fa05c7f | ||
| 
						 | 
					30900f7196 | ||
| 
						 | 
					b753cf0837 | ||
| 
						 | 
					53ab5b6aff | ||
| 
						 | 
					78a0402351 | ||
| 
						 | 
					5b5705fe90 | ||
| 
						 | 
					f08b5c5e3f | ||
| 
						 | 
					aa87acd432 | ||
| 
						 | 
					7af7ef8357 | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -9,3 +9,6 @@ indefero-*.zip
 | 
			
		||||
src/IDF/conf/path.php
 | 
			
		||||
.tx/config
 | 
			
		||||
src/IDF/locale/idf.pot.bak
 | 
			
		||||
test/test.db
 | 
			
		||||
test/tmp
 | 
			
		||||
test/config.php
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							@@ -31,6 +31,7 @@ Much appreciated contributors (in alphabetical order):
 | 
			
		||||
    Raphaël Emourgeon <raphael>
 | 
			
		||||
    Samuel Suther <info@suther.de>                  - German translation
 | 
			
		||||
    Sindre R. Myren <sindrero@stud.ntnu.no>
 | 
			
		||||
    Stewart Platt <stew@futurete.ch>
 | 
			
		||||
    Thomas Keller <me@thomaskeller.biz>             - Monotone support
 | 
			
		||||
    Vladimir Solomatin <slash>
 | 
			
		||||
    William Martin <william.martin@lcpc.fr>
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,12 @@ The installation of InDefero is composed of 2 parts, first the
 | 
			
		||||
installation of the [Pluf framework](http://www.pluf.org) and second,
 | 
			
		||||
the installation of InDefero by itself.
 | 
			
		||||
 | 
			
		||||
## PHP modules for indefero
 | 
			
		||||
 | 
			
		||||
Indefero need the GD module for PHP. It's named "php5-gd" in debian.
 | 
			
		||||
 | 
			
		||||
    $ apt-get install php5-gd
 | 
			
		||||
 | 
			
		||||
## Recommended Layout of the Files
 | 
			
		||||
 | 
			
		||||
If your server document root is in `/var/www` a good thing is to keep
 | 
			
		||||
@@ -126,6 +132,7 @@ The documentation is available in the `doc` folder.
 | 
			
		||||
* Subversion: `doc/syncsvn.mdtext`.
 | 
			
		||||
* Mercurial: `doc/syncmercurial.mdtext`.
 | 
			
		||||
* Git: `doc/syncgit.mdtext`.
 | 
			
		||||
* Monotone: `doc/syncmonotone.mdtext`
 | 
			
		||||
 | 
			
		||||
## For the Apache Webserver Users
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								Makefile
									
									
									
									
									
								
							@@ -37,6 +37,10 @@ help:
 | 
			
		||||
	@printf "\tpo-push    - Send the all PO files to the transifex server.\n"
 | 
			
		||||
	@printf "\tpo-pull    - Get all PO files from the transifex server.\n"
 | 
			
		||||
	@printf "\tpo-stats   - Show translation statistics of all PO files.\n"
 | 
			
		||||
	@printf "\nMisc Rules :\n";
 | 
			
		||||
	@printf "\tdb-install - Install the database schema.\n"
 | 
			
		||||
	@printf "\tdb-update  - Update the database schema.\n"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#   Internationalization rule, POT & PO file manipulation
 | 
			
		||||
@@ -139,3 +143,8 @@ po-stats:
 | 
			
		||||
		> indefero-$(@:-zipfile=)-`git log $(@:-zipfile=) -n 1 \
 | 
			
		||||
		--pretty=format:%h`.zip
 | 
			
		||||
 | 
			
		||||
db-install:
 | 
			
		||||
	@cd src && php $(PLUF_PATH)/migrate.php --conf=IDF/conf/idf.php -a -d -i
 | 
			
		||||
 | 
			
		||||
db-update:
 | 
			
		||||
	@cd src && php $(PLUF_PATH)/migrate.php --conf=IDF/conf/idf.php -a -d
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										20
									
								
								NEWS.mdtext
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								NEWS.mdtext
									
									
									
									
									
								
							@@ -1,3 +1,23 @@
 | 
			
		||||
# InDefero 1.2 - xxx xxx xx xx:xx 2011 UTC
 | 
			
		||||
 | 
			
		||||
ATTENTION: You need Pluf [324ae60b](http://projects.ceondo.com/p/pluf/source/commit/324ae60b)
 | 
			
		||||
or newer to properly run this version of Indefero!
 | 
			
		||||
 | 
			
		||||
## New Features
 | 
			
		||||
 | 
			
		||||
- Indefero's issue tracker can now bi-directionally link issues with variable, configurable
 | 
			
		||||
  terms, such as "is related to", "is blocked by" or "is duplicated by" (issue 638)
 | 
			
		||||
 | 
			
		||||
## Bugfixes
 | 
			
		||||
 | 
			
		||||
- monotone zip archive entries now all carry the revision date as mtime (issue 645)
 | 
			
		||||
- Timeline only displays filter options for items a user has actually access to (issue 655)
 | 
			
		||||
- Fix the self-link of the RSS feed (issue 666)
 | 
			
		||||
 | 
			
		||||
## Documentation
 | 
			
		||||
 | 
			
		||||
## Translations
 | 
			
		||||
 | 
			
		||||
# InDefero 1.1.1 - Mon Mar 28 15:52 2011 UTC
 | 
			
		||||
 | 
			
		||||
## Bugfixes
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										173
									
								
								logo/no_logo.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										173
									
								
								logo/no_logo.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,173 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 | 
			
		||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
 | 
			
		||||
 | 
			
		||||
<svg
 | 
			
		||||
   xmlns:dc="http://purl.org/dc/elements/1.1/"
 | 
			
		||||
   xmlns:cc="http://creativecommons.org/ns#"
 | 
			
		||||
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 | 
			
		||||
   xmlns:svg="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
 | 
			
		||||
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
 | 
			
		||||
   sodipodi:docname="no_logo.svg"
 | 
			
		||||
   inkscape:version="0.47 r22583"
 | 
			
		||||
   id="svg2985"
 | 
			
		||||
   height="32"
 | 
			
		||||
   width="32"
 | 
			
		||||
   version="1.1"
 | 
			
		||||
   inkscape:export-filename="/Users/tommyd/Entwicklung/indefero/www/media/idf/img/no_logo.png"
 | 
			
		||||
   inkscape:export-xdpi="89.989998"
 | 
			
		||||
   inkscape:export-ydpi="89.989998">
 | 
			
		||||
  <sodipodi:namedview
 | 
			
		||||
     pagecolor="#ffffff"
 | 
			
		||||
     bordercolor="#666666"
 | 
			
		||||
     borderopacity="1"
 | 
			
		||||
     objecttolerance="10"
 | 
			
		||||
     gridtolerance="10"
 | 
			
		||||
     guidetolerance="10"
 | 
			
		||||
     inkscape:pageopacity="0"
 | 
			
		||||
     inkscape:pageshadow="2"
 | 
			
		||||
     inkscape:window-width="1440"
 | 
			
		||||
     inkscape:window-height="852"
 | 
			
		||||
     id="namedview9"
 | 
			
		||||
     showgrid="false"
 | 
			
		||||
     inkscape:zoom="16.0625"
 | 
			
		||||
     inkscape:cx="8.5507561"
 | 
			
		||||
     inkscape:cy="16.122403"
 | 
			
		||||
     inkscape:window-x="0"
 | 
			
		||||
     inkscape:window-y="0"
 | 
			
		||||
     inkscape:window-maximized="0"
 | 
			
		||||
     inkscape:current-layer="g2847"
 | 
			
		||||
     showguides="true"
 | 
			
		||||
     inkscape:guide-bbox="true">
 | 
			
		||||
    <sodipodi:guide
 | 
			
		||||
       orientation="1,0"
 | 
			
		||||
       position="16,25.836575"
 | 
			
		||||
       id="guide3752" />
 | 
			
		||||
    <sodipodi:guide
 | 
			
		||||
       orientation="0,1"
 | 
			
		||||
       position="-18.677042,16"
 | 
			
		||||
       id="guide3754" />
 | 
			
		||||
  </sodipodi:namedview>
 | 
			
		||||
  <defs
 | 
			
		||||
     id="defs2987">
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       sodipodi:type="inkscape:persp3d"
 | 
			
		||||
       inkscape:vp_x="0 : 16 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_z="32 : 16 : 1"
 | 
			
		||||
       inkscape:persp3d-origin="16 : 10.666667 : 1"
 | 
			
		||||
       id="perspective13" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective2863"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective3676"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <inkscape:perspective
 | 
			
		||||
       id="perspective3717"
 | 
			
		||||
       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
 | 
			
		||||
       inkscape:vp_z="1 : 0.5 : 1"
 | 
			
		||||
       inkscape:vp_y="0 : 1000 : 0"
 | 
			
		||||
       inkscape:vp_x="0 : 0.5 : 1"
 | 
			
		||||
       sodipodi:type="inkscape:persp3d" />
 | 
			
		||||
    <filter
 | 
			
		||||
       inkscape:collect="always"
 | 
			
		||||
       id="filter3816"
 | 
			
		||||
       x="-0.14434362"
 | 
			
		||||
       width="1.2886872"
 | 
			
		||||
       y="-0.11562817"
 | 
			
		||||
       height="1.2312563">
 | 
			
		||||
      <feGaussianBlur
 | 
			
		||||
         inkscape:collect="always"
 | 
			
		||||
         stdDeviation="1.1799243"
 | 
			
		||||
         id="feGaussianBlur3818" />
 | 
			
		||||
    </filter>
 | 
			
		||||
  </defs>
 | 
			
		||||
  <metadata
 | 
			
		||||
     id="metadata2990">
 | 
			
		||||
    <rdf:RDF>
 | 
			
		||||
      <cc:Work
 | 
			
		||||
         rdf:about="">
 | 
			
		||||
        <dc:format>image/svg+xml</dc:format>
 | 
			
		||||
        <dc:type
 | 
			
		||||
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
 | 
			
		||||
        <dc:title></dc:title>
 | 
			
		||||
      </cc:Work>
 | 
			
		||||
    </rdf:RDF>
 | 
			
		||||
  </metadata>
 | 
			
		||||
  <g
 | 
			
		||||
     inkscape:groupmode="layer"
 | 
			
		||||
     id="layer2"
 | 
			
		||||
     inkscape:label="shadow"
 | 
			
		||||
     style="display:inline"
 | 
			
		||||
     sodipodi:insensitive="true">
 | 
			
		||||
    <g
 | 
			
		||||
       transform="translate(0.44042901,0.78704792)"
 | 
			
		||||
       id="g2847-8"
 | 
			
		||||
       style="opacity:0.79710143;fill:#000000;stroke:#000000;stroke-opacity:1;filter:url(#filter3816)">
 | 
			
		||||
      <g
 | 
			
		||||
         id="g3838-0"
 | 
			
		||||
         style="fill:#000000;stroke:#000000;stroke-opacity:1" />
 | 
			
		||||
      <g
 | 
			
		||||
         id="g2401-2"
 | 
			
		||||
         transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
 | 
			
		||||
         style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
         inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
 | 
			
		||||
         inkscape:export-xdpi="12.330909"
 | 
			
		||||
         inkscape:export-ydpi="12.330909">
 | 
			
		||||
        <path
 | 
			
		||||
           id="path2383-4"
 | 
			
		||||
           d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
 | 
			
		||||
           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
           inkscape:connector-curvature="0" />
 | 
			
		||||
        <path
 | 
			
		||||
           id="path2391-8"
 | 
			
		||||
           d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
 | 
			
		||||
           style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
           inkscape:connector-curvature="0" />
 | 
			
		||||
      </g>
 | 
			
		||||
    </g>
 | 
			
		||||
  </g>
 | 
			
		||||
  <g
 | 
			
		||||
     inkscape:groupmode="layer"
 | 
			
		||||
     id="layer3"
 | 
			
		||||
     inkscape:label="logo"
 | 
			
		||||
     style="display:inline">
 | 
			
		||||
    <g
 | 
			
		||||
       id="layer1"
 | 
			
		||||
       transform="translate(-0.06540759,0.09444087)">
 | 
			
		||||
      <g
 | 
			
		||||
         id="g2847">
 | 
			
		||||
        <g
 | 
			
		||||
           id="g3838" />
 | 
			
		||||
        <g
 | 
			
		||||
           id="g2401"
 | 
			
		||||
           transform="matrix(0.21219597,0,0,0.21219597,-70.751966,-27.73328)"
 | 
			
		||||
           style="fill:#e6e6e6;fill-opacity:1;stroke:#a0a0a0;stroke-width:2.4000001;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
           inkscape:export-filename="/home/loa/Projects/indefero/logo/powered-by-indefero.png"
 | 
			
		||||
           inkscape:export-xdpi="12.330909"
 | 
			
		||||
           inkscape:export-ydpi="12.330909">
 | 
			
		||||
          <path
 | 
			
		||||
             id="path2383"
 | 
			
		||||
             d="m 396.19089,173.14471 c -7.67621,0.80661 -14.40195,5.39406 -19.58101,10.89131 -7.23597,7.88004 -11.69742,18.07908 -13.32198,28.60362 -1.7236,11.28173 -0.25925,23.20635 5.07686,33.37271 3.78607,7.24384 9.53161,13.92339 17.29701,16.96772 3.86478,1.53937 8.98362,1.03284 11.67912,-2.41036 2.64357,-3.5671 2.69463,-8.234 2.85756,-12.48867 0.045,-7.61054 -0.54749,-15.25544 0.45618,-22.83193 0.87131,-9.50623 4.03944,-18.56751 6.71612,-27.66851 1.16242,-4.44333 2.25094,-9.02808 1.97499,-13.64988 -0.48817,-4.62476 -3.58059,-9.31042 -8.2964,-10.4067 -1.57489,-0.44882 -3.23412,-0.48948 -4.85845,-0.37931 z"
 | 
			
		||||
             style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
             inkscape:connector-curvature="0" />
 | 
			
		||||
          <path
 | 
			
		||||
             id="path2391"
 | 
			
		||||
             d="m 433.14691,149.28687 c 7.2059,2.76589 12.51512,8.93778 16.09494,15.58815 4.94991,9.48434 6.61962,20.49058 5.46486,31.07695 -1.25505,11.34342 -5.75582,22.48271 -13.54134,30.92159 -5.53192,6.01709 -12.81048,10.98198 -21.09918,11.91276 -4.13154,0.4866 -8.94486,-1.32748 -10.65734,-5.35104 -1.63027,-4.12976 -0.4717,-8.65084 0.47212,-12.80269 1.92628,-7.36287 4.47721,-14.59393 5.4687,-22.17201 1.61875,-9.40784 0.90381,-18.98034 0.67386,-28.46402 0.0272,-4.59278 0.1624,-9.30303 1.62515,-13.69592 1.66851,-4.34082 5.86829,-8.06645 10.70716,-7.90484 1.63738,-0.0259 3.25061,0.36424 4.79107,0.89107 z"
 | 
			
		||||
             style="fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#a0a0a0;stroke-width:2.4000001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
             inkscape:connector-curvature="0" />
 | 
			
		||||
        </g>
 | 
			
		||||
      </g>
 | 
			
		||||
    </g>
 | 
			
		||||
  </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 8.4 KiB  | 
							
								
								
									
										12
									
								
								phpunit.xml
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								phpunit.xml
									
									
									
									
									
								
							@@ -12,4 +12,16 @@
 | 
			
		||||
            <directory>test/IDF/</directory>
 | 
			
		||||
        </testsuite>
 | 
			
		||||
    </testsuites>
 | 
			
		||||
 | 
			
		||||
    <filter>
 | 
			
		||||
        <whitelist>
 | 
			
		||||
            <directory suffix=".php">src/IDF</directory>
 | 
			
		||||
            <exclude>
 | 
			
		||||
                <directory suffix=".php">src/IDF/Tests</directory>
 | 
			
		||||
                <directory suffix=".php">src/IDF/conf</directory>
 | 
			
		||||
                <file>src/IDF/version.php</file>
 | 
			
		||||
            </exclude>
 | 
			
		||||
        </whitelist>
 | 
			
		||||
    </filter>
 | 
			
		||||
</phpunit>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								run-tests
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								run-tests
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
#!/usr/bin/env php
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
$xmlfile = dirname(__FILE__) .'/test/report.xml';
 | 
			
		||||
passthru('phpunit --coverage-clover='.$xmlfile);
 | 
			
		||||
$xml = simplexml_load_string(file_get_contents($xmlfile));
 | 
			
		||||
unlink($xmlfile);
 | 
			
		||||
printf(
 | 
			
		||||
   '>>> code coverage %s/%s (%s%%)'."\n",
 | 
			
		||||
   $xml->project->metrics['coveredstatements'],
 | 
			
		||||
   $xml->project->metrics['statements'],
 | 
			
		||||
   round(($xml->project->metrics['coveredstatements']/(float)$xml->project->metrics['statements']) * 100.0, 2)
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
#
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -319,6 +319,7 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
 | 
			
		||||
                           'labels_issue_closed' => IDF_Form_IssueTrackingConf::init_closed,
 | 
			
		||||
                           'labels_issue_predefined' =>  IDF_Form_IssueTrackingConf::init_predefined,
 | 
			
		||||
                           'labels_issue_one_max' => IDF_Form_IssueTrackingConf::init_one_max,
 | 
			
		||||
                           'issue_relations' => IDF_Form_IssueTrackingConf::init_relations,
 | 
			
		||||
                           'webhook_url' => '',
 | 
			
		||||
                           'downloads_access_rights' => 'all',
 | 
			
		||||
                           'review_access_rights' => 'all',
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,19 +3,19 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# Plume Framework is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU Lesser General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2.1 of the License, or
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
# (at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# Plume Framework is distributed in the hope that it will be useful,
 | 
			
		||||
# InDefero is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
# GNU Lesser General Public License for more details.
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU Lesser General Public License
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -36,6 +36,7 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
    public $user = null;
 | 
			
		||||
    public $project = null;
 | 
			
		||||
    public $show_full = false;
 | 
			
		||||
    public $relation_types = null;
 | 
			
		||||
 | 
			
		||||
    public function initFields($extra=array())
 | 
			
		||||
    {
 | 
			
		||||
@@ -45,9 +46,12 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
            or $this->user->hasPerm('IDF.project-member', $this->project)) {
 | 
			
		||||
            $this->show_full = true;
 | 
			
		||||
        }
 | 
			
		||||
        $this->relation_types = $this->project->getRelationsFromConfig();
 | 
			
		||||
 | 
			
		||||
        $contentTemplate = $this->project->getConf()->getVal(
 | 
			
		||||
            'labels_issue_template', IDF_Form_IssueTrackingConf::init_template
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
        $this->fields['summary'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                            'label' => __('Summary'),
 | 
			
		||||
@@ -76,11 +80,11 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
        // case of someone allowing the upload path to be accessible
 | 
			
		||||
        // to everybody.
 | 
			
		||||
        for ($i=1;$i<4;$i++) {
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy'; 
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy';
 | 
			
		||||
            $this->fields['attachment'.$i] = new Pluf_Form_Field_File(
 | 
			
		||||
                array('required' => false,
 | 
			
		||||
                      'label' => __('Attach a file'),
 | 
			
		||||
                      'move_function_params' => 
 | 
			
		||||
                      'move_function_params' =>
 | 
			
		||||
                      array('upload_path' => $upload_path,
 | 
			
		||||
                            'upload_path_create' => true,
 | 
			
		||||
                            'file_name' => $filename,
 | 
			
		||||
@@ -109,6 +113,20 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
                                                                    ),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
            $this->fields['relation_type0'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => __('This issue'),
 | 
			
		||||
                                'initial' => current($this->relation_types),
 | 
			
		||||
                                'widget_attrs' => array('size' => 15),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            $this->fields['relation_issue0'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => null,
 | 
			
		||||
                                'initial' => '',
 | 
			
		||||
                                'widget_attrs' => array('size' => 10),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            /*
 | 
			
		||||
             * get predefined tags for issues from current project
 | 
			
		||||
             *
 | 
			
		||||
@@ -181,7 +199,7 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
            $this->cleaned_data['label'.$i] = trim($this->cleaned_data['label'.$i]);
 | 
			
		||||
            if (strpos($this->cleaned_data['label'.$i], ':') !== false) {
 | 
			
		||||
                list($class, $name) = explode(':', $this->cleaned_data['label'.$i], 2);
 | 
			
		||||
                list($class, $name) = array(mb_strtolower(trim($class)), 
 | 
			
		||||
                list($class, $name) = array(mb_strtolower(trim($class)),
 | 
			
		||||
                                            trim($name));
 | 
			
		||||
            } else {
 | 
			
		||||
                $class = 'other';
 | 
			
		||||
@@ -215,10 +233,10 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
    function clean_status()
 | 
			
		||||
    {
 | 
			
		||||
        // Check that the status is in the list of official status
 | 
			
		||||
        $tags = $this->project->getTagsFromConfig('labels_issue_open', 
 | 
			
		||||
        $tags = $this->project->getTagsFromConfig('labels_issue_open',
 | 
			
		||||
                                          IDF_Form_IssueTrackingConf::init_open,
 | 
			
		||||
                                          'Status');
 | 
			
		||||
        $tags = array_merge($this->project->getTagsFromConfig('labels_issue_closed', 
 | 
			
		||||
        $tags = array_merge($this->project->getTagsFromConfig('labels_issue_closed',
 | 
			
		||||
                                          IDF_Form_IssueTrackingConf::init_closed,
 | 
			
		||||
                                          'Status')
 | 
			
		||||
                            , $tags);
 | 
			
		||||
@@ -235,6 +253,63 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
        return $this->cleaned_data['status'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // this method is not called from Pluf_Form directly, but shared for
 | 
			
		||||
    // among all similar fields
 | 
			
		||||
    function clean_relation_type($value)
 | 
			
		||||
    {
 | 
			
		||||
        $relation_type = trim($value);
 | 
			
		||||
        if (empty($relation_type))
 | 
			
		||||
            return '';
 | 
			
		||||
 | 
			
		||||
        $found = false;
 | 
			
		||||
        foreach ($this->relation_types as $type) {
 | 
			
		||||
            if ($type == $relation_type) {
 | 
			
		||||
                $found = true;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (!$found) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('You provided an invalid relation type.'));
 | 
			
		||||
        }
 | 
			
		||||
        return $relation_type;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_relation_type0()
 | 
			
		||||
    {
 | 
			
		||||
        return $this->clean_relation_type($this->cleaned_data['relation_type0']);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // this method is not called from Pluf_Form directly, but shared for
 | 
			
		||||
    // among all similar fields
 | 
			
		||||
    function clean_relation_issue($value)
 | 
			
		||||
    {
 | 
			
		||||
        $issues = trim($value);
 | 
			
		||||
        if (empty($issues))
 | 
			
		||||
            return '';
 | 
			
		||||
 | 
			
		||||
        $issue_ids = preg_split('/\s*,\s*/', $issues, -1, PREG_SPLIT_NO_EMPTY);
 | 
			
		||||
        foreach ($issue_ids as $issue_id) {
 | 
			
		||||
            if (!ctype_digit($issue_id) || (int)$issue_id < 1) {
 | 
			
		||||
                throw new Pluf_Form_Invalid(sprintf(
 | 
			
		||||
                    __('The value "%s" is not a valid issue id.'), $issue_id
 | 
			
		||||
                ));
 | 
			
		||||
            }
 | 
			
		||||
            $issue = new IDF_Issue($issue_id);
 | 
			
		||||
            if ($issue->id != $issue_id || $issue->project != $this->project->id) {
 | 
			
		||||
                throw new Pluf_Form_Invalid(sprintf(
 | 
			
		||||
                    __('The issue "%s" does not exist.'), $issue_id
 | 
			
		||||
                ));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return implode(', ', $issue_ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_relation_issue0()
 | 
			
		||||
    {
 | 
			
		||||
        return $this->clean_relation_issue($this->cleaned_data['relation_issue0']);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Clean the attachments post failure.
 | 
			
		||||
     */
 | 
			
		||||
@@ -298,6 +373,30 @@ class IDF_Form_IssueCreate extends Pluf_Form
 | 
			
		||||
        foreach ($tags as $tag) {
 | 
			
		||||
            $issue->setAssoc($tag);
 | 
			
		||||
        }
 | 
			
		||||
        // add relations (if any)
 | 
			
		||||
        if (!empty($this->cleaned_data['relation_type0'])) {
 | 
			
		||||
            $verb = $this->cleaned_data['relation_type0'];
 | 
			
		||||
            $other_verb = $this->relation_types[$verb];
 | 
			
		||||
            $related_issues = preg_split('/\s*,\s*/', $this->cleaned_data['relation_issue0'], -1, PREG_SPLIT_NO_EMPTY);
 | 
			
		||||
 | 
			
		||||
            foreach ($related_issues as $related_issue_id) {
 | 
			
		||||
                $related_issue = new IDF_Issue($related_issue_id);
 | 
			
		||||
                $rel = new IDF_IssueRelation();
 | 
			
		||||
                $rel->issue = $issue;
 | 
			
		||||
                $rel->verb = $verb;
 | 
			
		||||
                $rel->other_issue = $related_issue;
 | 
			
		||||
                $rel->submitter = $this->user;
 | 
			
		||||
                $rel->create();
 | 
			
		||||
 | 
			
		||||
                $other_rel = new IDF_IssueRelation();
 | 
			
		||||
                $other_rel->issue = $related_issue;
 | 
			
		||||
                $other_rel->verb = $other_verb;
 | 
			
		||||
                $other_rel->other_issue = $issue;
 | 
			
		||||
                $other_rel->submitter = $this->user;
 | 
			
		||||
                $other_rel->create();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // add the first comment
 | 
			
		||||
        $comment = new IDF_IssueComment();
 | 
			
		||||
        $comment->issue = $issue;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -72,6 +72,23 @@ Performance          = Performance issue
 | 
			
		||||
Usability            = Affects program usability
 | 
			
		||||
Maintainability      = Hinders future changes';
 | 
			
		||||
    const init_one_max = 'Type, Priority, Milestone';
 | 
			
		||||
    // ATTENTION: if you change something here, change the values below as well!
 | 
			
		||||
    const init_relations = 'is related to
 | 
			
		||||
blocks, is blocked by
 | 
			
		||||
duplicates, is duplicated by';
 | 
			
		||||
 | 
			
		||||
    // These are actually all noop's, but we have no other chance to
 | 
			
		||||
    // tell IDF's translation mechanism to mark the strings as translatable
 | 
			
		||||
    // FIXME: IDF should get a internal translation system for strings like
 | 
			
		||||
    // that, that can also be easily expanded by users
 | 
			
		||||
    private function noop()
 | 
			
		||||
    {
 | 
			
		||||
        __('is related to');
 | 
			
		||||
        __('blocks');
 | 
			
		||||
        __('is blocked by');
 | 
			
		||||
        __('duplicates');
 | 
			
		||||
        __('is duplicated by');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function initFields($extra=array())
 | 
			
		||||
    {
 | 
			
		||||
@@ -114,10 +131,19 @@ Maintainability      = Hinders future changes';
 | 
			
		||||
        $this->fields['labels_issue_one_max'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('Each issue may have at most one label with each of these classes'),
 | 
			
		||||
                                            'initial' => self::init_one_max, 
 | 
			
		||||
                                            'initial' => self::init_one_max,
 | 
			
		||||
                                            'widget_attrs' => array('size' => 60),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['issue_relations'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                            'label' => __('Issue relations'),
 | 
			
		||||
                                            'initial' => self::init_relations,
 | 
			
		||||
                                            'help_text' => __('You can define bidirectional relations like "is related to" or "blocks, is blocked by".'),
 | 
			
		||||
                                            'widget_attrs' => array('rows' => 7,
 | 
			
		||||
                                                                    'cols' => 75),
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
                                            ));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -39,6 +39,7 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
            or $this->user->hasPerm('IDF.project-member', $this->project)) {
 | 
			
		||||
            $this->show_full = true;
 | 
			
		||||
        }
 | 
			
		||||
        $this->relation_types = $this->project->getRelationsFromConfig();
 | 
			
		||||
        if ($this->show_full) {
 | 
			
		||||
            $this->fields['summary'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
@@ -69,11 +70,11 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
        // case of someone allowing the upload path to be accessible
 | 
			
		||||
        // to everybody.
 | 
			
		||||
        for ($i=1;$i<4;$i++) {
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy'; 
 | 
			
		||||
            $filename = substr($md5, 0, 2).'/'.substr($md5, 2, 2).'/'.substr($md5, 4).'/%s.dummy';
 | 
			
		||||
            $this->fields['attachment'.$i] = new Pluf_Form_Field_File(
 | 
			
		||||
                array('required' => false,
 | 
			
		||||
                      'label' => __('Attach a file'),
 | 
			
		||||
                      'move_function_params' => 
 | 
			
		||||
                      'move_function_params' =>
 | 
			
		||||
                      array('upload_path' => $upload_path,
 | 
			
		||||
                            'upload_path_create' => true,
 | 
			
		||||
                            'file_name' => $filename,
 | 
			
		||||
@@ -102,6 +103,52 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
                                                       'size' => 15,
 | 
			
		||||
                                                                    ),
 | 
			
		||||
                                            ));
 | 
			
		||||
 | 
			
		||||
            $idx = 0;
 | 
			
		||||
            // note: clean_relation_type0 and clean_relation_issue0 already
 | 
			
		||||
            //       exist in the base class
 | 
			
		||||
            $this->fields['relation_type'.$idx] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => __('This issue'),
 | 
			
		||||
                                'initial' => current($this->relation_types),
 | 
			
		||||
                                'widget_attrs' => array('size' => 15),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            $this->fields['relation_issue'.$idx] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => null,
 | 
			
		||||
                                'initial' => '',
 | 
			
		||||
                                'widget_attrs' => array('size' => 10),
 | 
			
		||||
                                ));
 | 
			
		||||
 | 
			
		||||
            ++$idx;
 | 
			
		||||
            $relatedIssues = $this->issue->getGroupedRelatedIssues(array(), true);
 | 
			
		||||
            foreach ($relatedIssues as $verb => $ids) {
 | 
			
		||||
                $this->fields['relation_type'.$idx] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                          array('required' => false,
 | 
			
		||||
                                'label' => __('This issue'),
 | 
			
		||||
                                'initial' => $verb,
 | 
			
		||||
                                'widget_attrs' => array('size' => 15),
 | 
			
		||||
                                ));
 | 
			
		||||
                $m = 'clean_relation_type'.$idx;
 | 
			
		||||
                $this->$m = create_function('$form', '
 | 
			
		||||
                    return $form->clean_relation_type($form->cleaned_data["relation_type'.$idx.'"]);
 | 
			
		||||
                ');
 | 
			
		||||
 | 
			
		||||
                $this->fields['relation_issue'.$idx] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                              array('required' => false,
 | 
			
		||||
                                    'label' => null,
 | 
			
		||||
                                    'initial' => implode(', ', $ids),
 | 
			
		||||
                                    'widget_attrs' => array('size' => 10),
 | 
			
		||||
                                    ));
 | 
			
		||||
                $m = 'clean_relation_issue'.$idx;
 | 
			
		||||
                $this->$m = create_function('$form', '
 | 
			
		||||
                    return $form->clean_relation_issue($form->cleaned_data["relation_issue'.$idx.'"]);
 | 
			
		||||
                ');
 | 
			
		||||
 | 
			
		||||
                ++$idx;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $tags = $this->issue->get_tags_list();
 | 
			
		||||
            for ($i=1;$i<7;$i++) {
 | 
			
		||||
                $initial = '';
 | 
			
		||||
@@ -155,6 +202,51 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
    public function clean()
 | 
			
		||||
    {
 | 
			
		||||
        $this->cleaned_data = parent::clean();
 | 
			
		||||
 | 
			
		||||
        // normalize the user's input by removing dublettes and by combining
 | 
			
		||||
        // ids from identical verbs in different input fields into one array
 | 
			
		||||
        $normRelatedIssues = array();
 | 
			
		||||
        for ($idx = 0; isset($this->cleaned_data['relation_type'.$idx]); ++$idx) {
 | 
			
		||||
            $verb = $this->cleaned_data['relation_type'.$idx];
 | 
			
		||||
            if (empty($verb))
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
            $ids = preg_split('/\s*,\s*/', $this->cleaned_data['relation_issue'.$idx],
 | 
			
		||||
                              -1, PREG_SPLIT_NO_EMPTY);
 | 
			
		||||
            if (count($ids) == 0)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
            if (!array_key_exists($verb, $normRelatedIssues))
 | 
			
		||||
                $normRelatedIssues[$verb] = array();
 | 
			
		||||
            foreach ($ids as $id) {
 | 
			
		||||
                if (!in_array($id, $normRelatedIssues[$verb]))
 | 
			
		||||
                    $normRelatedIssues[$verb][] = $id;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // now look at any added / removed ids
 | 
			
		||||
        $added = $removed = array();
 | 
			
		||||
        $relatedIssues = $this->issue->getGroupedRelatedIssues(array(), true);
 | 
			
		||||
        $added = array_diff_key($normRelatedIssues, $relatedIssues);
 | 
			
		||||
        $removed = array_diff_key($relatedIssues, $normRelatedIssues);
 | 
			
		||||
 | 
			
		||||
        $keysToLookAt = array_keys(
 | 
			
		||||
            array_intersect_key($relatedIssues, $normRelatedIssues)
 | 
			
		||||
        );
 | 
			
		||||
        foreach ($keysToLookAt as $key) {
 | 
			
		||||
            $a = array_diff($normRelatedIssues[$key], $relatedIssues[$key]);
 | 
			
		||||
            if (count($a) > 0)
 | 
			
		||||
                $added[$key] = $a;
 | 
			
		||||
            $r = array_diff($relatedIssues[$key], $normRelatedIssues[$key]);
 | 
			
		||||
            if (count($r) > 0)
 | 
			
		||||
                $removed[$key] = $r;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // cache the added / removed data, so we do not have to
 | 
			
		||||
        // calculate that again
 | 
			
		||||
        $this->cleaned_data['_added_issue_relations'] = $added;
 | 
			
		||||
        $this->cleaned_data['_removed_issue_relations'] = $removed;
 | 
			
		||||
 | 
			
		||||
        // As soon as we know that at least one change was done, we
 | 
			
		||||
        // return the cleaned data and do not go further.
 | 
			
		||||
        if (strlen(trim($this->cleaned_data['content']))) {
 | 
			
		||||
@@ -214,6 +306,11 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
                    return $this->cleaned_data;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (count($this->cleaned_data['_added_issue_relations']) != 0 ||
 | 
			
		||||
                count($this->cleaned_data['_removed_issue_relations']) != 0) {
 | 
			
		||||
                return $this->cleaned_data;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        // no changes!
 | 
			
		||||
        throw new Pluf_Form_Invalid(__('No changes were entered.'));
 | 
			
		||||
@@ -255,20 +352,22 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
            foreach ($tags as $tag) {
 | 
			
		||||
                if (!Pluf_Model_InArray($tag, $oldtags)) {
 | 
			
		||||
                    if (!isset($changes['lb'])) $changes['lb'] = array();
 | 
			
		||||
                    if (!isset($changes['lb']['add'])) $changes['lb']['add'] = array();
 | 
			
		||||
                    if ($tag->class != 'Other') {
 | 
			
		||||
                        $changes['lb'][] = (string) $tag; //new tag
 | 
			
		||||
                        $changes['lb']['add'][] = (string) $tag; //new tag
 | 
			
		||||
                    } else {
 | 
			
		||||
                        $changes['lb'][] = (string) $tag->name;
 | 
			
		||||
                        $changes['lb']['add'][] = (string) $tag->name;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            foreach ($oldtags as $tag) {
 | 
			
		||||
                if (!Pluf_Model_InArray($tag, $tags)) {
 | 
			
		||||
                    if (!isset($changes['lb'])) $changes['lb'] = array();
 | 
			
		||||
                    if (!isset($changes['lb']['rem'])) $changes['lb']['rem'] = array();
 | 
			
		||||
                    if ($tag->class != 'Other') {
 | 
			
		||||
                        $changes['lb'][] = '-'.(string) $tag; //new tag
 | 
			
		||||
                        $changes['lb']['rem'][] = (string) $tag; //new tag
 | 
			
		||||
                    } else {
 | 
			
		||||
                        $changes['lb'][] = '-'.(string) $tag->name;
 | 
			
		||||
                        $changes['lb']['rem'][] = (string) $tag->name;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -286,6 +385,47 @@ class IDF_Form_IssueUpdate  extends IDF_Form_IssueCreate
 | 
			
		||||
                or ((!is_null($owner) and !is_null($this->issue->get_owner())) and $owner->id != $this->issue->get_owner()->id)) {
 | 
			
		||||
                $changes['ow'] = (is_null($owner)) ? '---' : $owner->login;
 | 
			
		||||
            }
 | 
			
		||||
            // Issue relations - additions
 | 
			
		||||
            foreach ($this->cleaned_data['_added_issue_relations'] as $verb => $ids) {
 | 
			
		||||
                $other_verb = $this->relation_types[$verb];
 | 
			
		||||
                foreach ($ids as $id) {
 | 
			
		||||
                    $related_issue = new IDF_Issue($id);
 | 
			
		||||
                    $rel = new IDF_IssueRelation();
 | 
			
		||||
                    $rel->issue = $this->issue;
 | 
			
		||||
                    $rel->verb = $verb;
 | 
			
		||||
                    $rel->other_issue = $related_issue;
 | 
			
		||||
                    $rel->submitter = $this->user;
 | 
			
		||||
                    $rel->create();
 | 
			
		||||
 | 
			
		||||
                    $other_rel = new IDF_IssueRelation();
 | 
			
		||||
                    $other_rel->issue = $related_issue;
 | 
			
		||||
                    $other_rel->verb = $other_verb;
 | 
			
		||||
                    $other_rel->other_issue = $this->issue;
 | 
			
		||||
                    $other_rel->submitter = $this->user;
 | 
			
		||||
                    $other_rel->create();
 | 
			
		||||
                }
 | 
			
		||||
                if (!isset($changes['rel'])) $changes['rel'] = array();
 | 
			
		||||
                if (!isset($changes['rel']['add'])) $changes['rel']['add'] = array();
 | 
			
		||||
                $changes['rel']['add'][] = $verb.' '.implode(', ', $ids);
 | 
			
		||||
            }
 | 
			
		||||
            // Issue relations - removals
 | 
			
		||||
            foreach ($this->cleaned_data['_removed_issue_relations'] as $verb => $ids) {
 | 
			
		||||
                foreach ($ids as $id) {
 | 
			
		||||
                    $db = &Pluf::db();
 | 
			
		||||
                    $table = Pluf::factory('IDF_IssueRelation')->getSqlTable();
 | 
			
		||||
                    $sql = new Pluf_SQL('verb=%s AND (
 | 
			
		||||
                                        (issue=%s AND other_issue=%s) OR
 | 
			
		||||
                                        (other_issue=%s AND issue=%s))',
 | 
			
		||||
                                        array($verb,
 | 
			
		||||
                                              $this->issue->id, $id,
 | 
			
		||||
                                              $this->issue->id, $id));
 | 
			
		||||
                    $db->execute('DELETE FROM '.$table.' WHERE '.$sql->gen());
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (!isset($changes['rel'])) $changes['rel'] = array();
 | 
			
		||||
                if (!isset($changes['rel']['rem'])) $changes['rel']['rem'] = array();
 | 
			
		||||
                $changes['rel']['rem'][] = $verb.' '.implode(', ', $ids);
 | 
			
		||||
            }
 | 
			
		||||
            // Update the issue
 | 
			
		||||
            $this->issue->batchAssoc('IDF_Tag', $tagids);
 | 
			
		||||
            $this->issue->summary = trim($this->cleaned_data['summary']);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										140
									
								
								src/IDF/Form/ProjectConf.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										140
									
								
								src/IDF/Form/ProjectConf.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,140 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright(C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
#(at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Configuration of the project.
 | 
			
		||||
 */
 | 
			
		||||
class IDF_Form_ProjectConf extends Pluf_Form
 | 
			
		||||
{
 | 
			
		||||
    public $project = null;
 | 
			
		||||
 | 
			
		||||
    public function initFields($extra=array())
 | 
			
		||||
    {
 | 
			
		||||
        $this->project = $extra['project'];
 | 
			
		||||
 | 
			
		||||
        // Basic part
 | 
			
		||||
        $this->fields['name'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                  'label' => __('Name'),
 | 
			
		||||
                                                                  'initial' => $this->project->name,
 | 
			
		||||
                                                                 ));
 | 
			
		||||
        $this->fields['shortdesc'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                       'label' => __('Short Description'),
 | 
			
		||||
                                                                       'initial' => $this->project->shortdesc,
 | 
			
		||||
                                                                       'widget_attrs' => array('size' => '68'),
 | 
			
		||||
                                                                      ));
 | 
			
		||||
        $this->fields['description'] = new Pluf_Form_Field_Varchar(array('required' => true,
 | 
			
		||||
                                                                         'label' => __('Description'),
 | 
			
		||||
                                                                         'initial' => $this->project->description,
 | 
			
		||||
                                                                         'widget_attrs' => array('cols' => 68,
 | 
			
		||||
                                                                                                 'rows' => 26,
 | 
			
		||||
                                                                                                ),
 | 
			
		||||
                                                                         'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
                                                                        ));
 | 
			
		||||
 | 
			
		||||
        // Logo part
 | 
			
		||||
        $upload_path = Pluf::f('upload_path', false);
 | 
			
		||||
        if (false === $upload_path) {
 | 
			
		||||
            throw new Pluf_Exception_SettingError(__('The "upload_path" configuration variable was not set.'));
 | 
			
		||||
        }
 | 
			
		||||
        $upload_path .= '/' . $this->project->shortname;
 | 
			
		||||
        $filename = '/%s';
 | 
			
		||||
        $this->fields['logo'] = new Pluf_Form_Field_File(array('required' => false,
 | 
			
		||||
                                                         'label' => __('Update the logo'),
 | 
			
		||||
                                                         'initial' => '',
 | 
			
		||||
                                                         'help_text' => __('The logo must be a picture with a size of 32 by 32.'),
 | 
			
		||||
                                                         'max_size' => Pluf::f('max_upload_size', 5 * 1024),
 | 
			
		||||
                                                         'move_function_params' =>
 | 
			
		||||
                                                         array('upload_path' => $upload_path,
 | 
			
		||||
                                                               'upload_path_create' => true,
 | 
			
		||||
                                                               'file_name' => $filename,
 | 
			
		||||
                                                               )
 | 
			
		||||
                                                         ));
 | 
			
		||||
 | 
			
		||||
        $this->fields['logo_remove'] = new Pluf_Form_Field_Boolean(array('required' => false,
 | 
			
		||||
                                                                         'label' => __('Remove the current logo'),
 | 
			
		||||
                                                                         'initial' => false,
 | 
			
		||||
                                                                         'widget' => 'Pluf_Form_Widget_CheckboxInput',
 | 
			
		||||
                                                                         ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * If we have uploaded a file, but the form failed remove it.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
    function failed()
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($this->cleaned_data['logo'])
 | 
			
		||||
            && file_exists(Pluf::f('upload_path').'/'.$this->cleaned_data['logo'])) {
 | 
			
		||||
            unlink(Pluf::f('upload_path').'/'.$this->cleaned_data['logo']);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function clean()
 | 
			
		||||
    {
 | 
			
		||||
        if (!isset($this->cleaned_data['logo_remove'])) {
 | 
			
		||||
            $this->cleaned_data['logo_remove'] = false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this->cleaned_data;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function clean_logo()
 | 
			
		||||
    {
 | 
			
		||||
        if (empty($this->cleaned_data['logo'])) {
 | 
			
		||||
            return '';
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $meta = getimagesize(Pluf::f('upload_path') . '/' . $this->project->shortname . $this->cleaned_data['logo']);
 | 
			
		||||
 | 
			
		||||
        if ($meta === false) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('Could not determine the size of the uploaded picture.'));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($meta[0] !== 32 || $meta[1] !== 32) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('The picture must have a size of 32 by 32.'));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $this->cleaned_data['logo'];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function save($commit=true)
 | 
			
		||||
    {
 | 
			
		||||
        $conf = $this->project->getConf();
 | 
			
		||||
 | 
			
		||||
        // Basic part
 | 
			
		||||
        $this->project->name = $this->cleaned_data['name'];
 | 
			
		||||
        $this->project->shortdesc = $this->cleaned_data['shortdesc'];
 | 
			
		||||
        $this->project->description = $this->cleaned_data['description'];
 | 
			
		||||
        $this->project->update();
 | 
			
		||||
 | 
			
		||||
        // Logo part
 | 
			
		||||
        if ($this->cleaned_data['logo'] !== "") {
 | 
			
		||||
            $conf->setVal('logo', $this->cleaned_data['logo']);
 | 
			
		||||
        }
 | 
			
		||||
        if ($this->cleaned_data['logo_remove'] === true) {
 | 
			
		||||
            @unlink(Pluf::f('upload_path') . '/' . $this->project->shortname . $conf->getVal('logo'));
 | 
			
		||||
            $conf->delVal('logo');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -52,7 +52,7 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
 | 
			
		||||
                                            ));
 | 
			
		||||
        }
 | 
			
		||||
        $this->fields['content'] = new Pluf_Form_Field_Varchar(
 | 
			
		||||
                                      array('required' => true,
 | 
			
		||||
                                      array('required' => false,
 | 
			
		||||
                                            'label' => __('General comment'),
 | 
			
		||||
                                            'initial' => '',
 | 
			
		||||
                                            'widget' => 'Pluf_Form_Widget_TextareaInput',
 | 
			
		||||
@@ -96,24 +96,40 @@ class IDF_Form_ReviewFileComment extends Pluf_Form
 | 
			
		||||
     */
 | 
			
		||||
    public function clean()
 | 
			
		||||
    {
 | 
			
		||||
        foreach ($this->files as $filename => $def) {
 | 
			
		||||
            if (!empty($this->cleaned_data[md5($filename)])) {
 | 
			
		||||
                return $this->cleaned_data;
 | 
			
		||||
        $isOk = false;
 | 
			
		||||
        
 | 
			
		||||
        foreach($this->files as $filename => $def) {
 | 
			
		||||
            $this->cleaned_data[md5($filename)] = trim($this->cleaned_data[md5($filename)]);
 | 
			
		||||
            if(!empty($this->cleaned_data[md5($filename)])) {
 | 
			
		||||
                $isOk = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        throw new Pluf_Form_Invalid(__('You need to provide comments on at least one file.'));
 | 
			
		||||
        
 | 
			
		||||
        if(!empty($this->cleaned_data['content'])) {
 | 
			
		||||
            $isOk = true;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if (!$isOk) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal, or comments on at least one file.'));
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        return $this->cleaned_data;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function clean_content()
 | 
			
		||||
    {
 | 
			
		||||
        $content = trim($this->cleaned_data['content']);
 | 
			
		||||
        if (!$this->show_full and strlen($content) == 0) {
 | 
			
		||||
            throw new Pluf_Form_Invalid(__('You need to provide your general comment about the proposal.'));
 | 
			
		||||
        if(empty($content)) {
 | 
			
		||||
            if ($this->fields['status']->initial != $this->fields['status']->value) {
 | 
			
		||||
                return __('The status have been updated.');
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            return $content;
 | 
			
		||||
        }
 | 
			
		||||
        return $content;
 | 
			
		||||
        
 | 
			
		||||
        throw new Pluf_Form_Invalid(__('This field is required.'));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Save the model in the database.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -169,6 +169,24 @@ class IDF_Issue extends Pluf_Model
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function getGroupedRelatedIssues($opts = array(), $idsOnly = false)
 | 
			
		||||
    {
 | 
			
		||||
        $rels = $this->get_related_issues_list(array_merge($opts, array(
 | 
			
		||||
               'view' => 'with_other_issue',
 | 
			
		||||
        )));
 | 
			
		||||
 | 
			
		||||
        $res = array();
 | 
			
		||||
        foreach ($rels as $rel) {
 | 
			
		||||
            $verb = $rel->verb;
 | 
			
		||||
            if (!array_key_exists($verb, $res)) {
 | 
			
		||||
                $res[$verb] = array();
 | 
			
		||||
            }
 | 
			
		||||
            $res[$verb][] = $idsOnly ? $rel->other_issue : $rel;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns an HTML fragment used to display this issue in the
 | 
			
		||||
     * timeline.
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -155,10 +155,19 @@ class IDF_IssueComment extends Pluf_Model
 | 
			
		||||
                    $out .= __('Owner:'); break;
 | 
			
		||||
                case 'lb':
 | 
			
		||||
                    $out .= __('Labels:'); break;
 | 
			
		||||
                case 'rel':
 | 
			
		||||
                    $out .= __('Relations:'); break;
 | 
			
		||||
                }
 | 
			
		||||
                $out .= '</strong> ';
 | 
			
		||||
                if ($w == 'lb') {
 | 
			
		||||
                    $out .= Pluf_esc(implode(', ', $v));
 | 
			
		||||
                if ($w == 'lb' || $w == 'rel') {
 | 
			
		||||
                    foreach ($v as $t => $ls) {
 | 
			
		||||
                        foreach ($ls as $l) {
 | 
			
		||||
                            if ($t == 'rem') $out .= '<s>';
 | 
			
		||||
                            $out .= Pluf_esc($l);
 | 
			
		||||
                            if ($t == 'rem') $out .= '</s>';
 | 
			
		||||
                            $out .= ' ';
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    $out .= Pluf_esc($v);
 | 
			
		||||
                }
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										100
									
								
								src/IDF/IssueRelation.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/IDF/IssueRelation.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
# (at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A relation of one issue to another
 | 
			
		||||
 */
 | 
			
		||||
class IDF_IssueRelation extends Pluf_Model
 | 
			
		||||
{
 | 
			
		||||
    public $_model = __CLASS__;
 | 
			
		||||
 | 
			
		||||
    function init()
 | 
			
		||||
    {
 | 
			
		||||
        $this->_a['table'] = 'idf_issuerelations';
 | 
			
		||||
        $this->_a['model'] = __CLASS__;
 | 
			
		||||
        $this->_a['cols'] = array(
 | 
			
		||||
                             // It is mandatory to have an "id" column.
 | 
			
		||||
                            'id' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Sequence',
 | 
			
		||||
                                  'blank' => true,
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'issue' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Foreignkey',
 | 
			
		||||
                                  'model' => 'IDF_Issue',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('issue'),
 | 
			
		||||
                                  'relate_name' => 'related_issues',
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'verb' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Text',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('verb'),
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'other_issue' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Foreignkey',
 | 
			
		||||
                                  'model' => 'IDF_Issue',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('other issue'),
 | 
			
		||||
                                  'relate_name' => 'related_other_issues',
 | 
			
		||||
                                  ),
 | 
			
		||||
                            'submitter' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Foreignkey',
 | 
			
		||||
                                  'model' => 'Pluf_User',
 | 
			
		||||
                                  'blank' => false,
 | 
			
		||||
                                  'verbose' => __('submitter'),
 | 
			
		||||
                                   ),
 | 
			
		||||
                            'creation_dtime' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'type' => 'Pluf_DB_Field_Datetime',
 | 
			
		||||
                                  'blank' => true,
 | 
			
		||||
                                  'verbose' => __('creation date'),
 | 
			
		||||
                                  ),
 | 
			
		||||
                            );
 | 
			
		||||
        $this->_a['idx'] = array(
 | 
			
		||||
                            'creation_dtime_idx' =>
 | 
			
		||||
                            array(
 | 
			
		||||
                                  'col' => 'creation_dtime',
 | 
			
		||||
                                  'type' => 'normal',
 | 
			
		||||
                                  ),
 | 
			
		||||
                            );
 | 
			
		||||
        $issuetbl = $this->_con->pfx.'idf_issues';
 | 
			
		||||
        $this->_a['views'] = array(
 | 
			
		||||
            'with_other_issue' => array(
 | 
			
		||||
                'join' => 'INNER JOIN '.$issuetbl.' ON other_issue='.$issuetbl.'.id',
 | 
			
		||||
                'select' => $this->getSelect().', summary',
 | 
			
		||||
                'props' => array('summary' => 'other_summary'),
 | 
			
		||||
        ));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function preSave($create=false)
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->id == '') {
 | 
			
		||||
            $this->creation_dtime = gmdate('Y-m-d H:i:s');
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -80,7 +80,10 @@ class IDF_Key extends Pluf_Model
 | 
			
		||||
        if (preg_match('#^\[pubkey ([^\]]+)\]\s*(\S+)\s*\[end\]$#', $this->content, $m)) {
 | 
			
		||||
            return array('mtn', $m[1], $m[2]);
 | 
			
		||||
        }
 | 
			
		||||
        else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S+))?$#', $this->content, $m)) {
 | 
			
		||||
        else if (preg_match('#^ssh\-[a-z]{3}\s(\S+)(?:\s(\S*))?$#', $this->content, $m)) {
 | 
			
		||||
            if (!isset($m[2])) {
 | 
			
		||||
                $m[2] = "";
 | 
			
		||||
            }
 | 
			
		||||
            return array('ssh', $m[2], $m[1]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										90
									
								
								src/IDF/Migrations/17AddIssueRelations.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								src/IDF/Migrations/17AddIssueRelations.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,90 @@
 | 
			
		||||
<?php
 | 
			
		||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
# (at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 | 
			
		||||
#
 | 
			
		||||
# ***** END LICENSE BLOCK ***** */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Add the new IDF_IssueRelation model.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function IDF_Migrations_17AddIssueRelations_up($params=null)
 | 
			
		||||
{
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
    $schema->model = new IDF_IssueRelation();
 | 
			
		||||
    $schema->createTables();
 | 
			
		||||
 | 
			
		||||
    // change the serialization format for added / removed labels in IDF_IssueComment
 | 
			
		||||
    $comments = Pluf::factory('IDF_IssueComment')->getList();
 | 
			
		||||
    foreach ($comments as $comment) {
 | 
			
		||||
        if (!isset($comment->changes['lb'])) continue;
 | 
			
		||||
        $changes = $comment->changes;
 | 
			
		||||
        $adds = $removals = array();
 | 
			
		||||
        foreach ($comment->changes['lb'] as $lb) {
 | 
			
		||||
            if (substr($lb, 0, 1) == '-')
 | 
			
		||||
                $removals[] = substr($lb, 1);
 | 
			
		||||
            else
 | 
			
		||||
                $adds[] = $lb;
 | 
			
		||||
        }
 | 
			
		||||
        $changes['lb'] = array();
 | 
			
		||||
        if (count($adds) > 0)
 | 
			
		||||
            $changes['lb']['add'] = $adds;
 | 
			
		||||
        if (count($removals) > 0)
 | 
			
		||||
            $changes['lb']['rem'] = $removals;
 | 
			
		||||
        $comment->changes = $changes;
 | 
			
		||||
        $comment->update();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function IDF_Migrations_17AddIssueRelations_down($params=null)
 | 
			
		||||
{
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
    $schema->model = new IDF_IssueRelation();
 | 
			
		||||
    $schema->dropTables();
 | 
			
		||||
 | 
			
		||||
    // change the serialization format for added / removed labels in IDF_IssueComment
 | 
			
		||||
    $comments = Pluf::factory('IDF_IssueComment')->getList();
 | 
			
		||||
    foreach ($comments as $comment) {
 | 
			
		||||
        $changes = $comment->changes;
 | 
			
		||||
        if (empty($changes))
 | 
			
		||||
            continue;
 | 
			
		||||
        if (isset($changes['lb'])) {
 | 
			
		||||
            $labels = array();
 | 
			
		||||
            foreach ($changes['lb'] as $type => $lbs) {
 | 
			
		||||
                if (!is_array($lbs)) {
 | 
			
		||||
                    $labels[] = $lbs;
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
                foreach ($lbs as $lb) {
 | 
			
		||||
                    $labels[] = ($type == 'rem' ? '-' : '') . $lb;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            $changes['lb'] = $labels;
 | 
			
		||||
        }
 | 
			
		||||
        // while we're at it, remove any 'rel' changes
 | 
			
		||||
        unset($changes['rel']);
 | 
			
		||||
        $comment->changes = $changes;
 | 
			
		||||
        $comment->update();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -54,6 +54,7 @@ function IDF_Migrations_Backup_run($folder, $name=null)
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    'IDF_IssueRelation',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    // Now, for each table, we dump the content in json, this is a
 | 
			
		||||
@@ -100,6 +101,7 @@ function IDF_Migrations_Backup_restore($folder, $name)
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    'IDF_IssueRelation',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -51,6 +51,7 @@ function IDF_Migrations_Install_setup($params=null)
 | 
			
		||||
                    'IDF_Queue',
 | 
			
		||||
                    'IDF_Gconf',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    'IDF_IssueRelation',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
@@ -109,6 +110,7 @@ function IDF_Migrations_Install_teardown($params=null)
 | 
			
		||||
                    'IDF_Commit',
 | 
			
		||||
                    'IDF_Project',
 | 
			
		||||
                    'IDF_EmailAddress',
 | 
			
		||||
                    'IDF_IssueRelation',
 | 
			
		||||
                    );
 | 
			
		||||
    $db = Pluf::db();
 | 
			
		||||
    $schema = new Pluf_DB_Schema($db);
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2010 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2010 Thomas Keller <me@thomaskeller.biz>
 | 
			
		||||
--                    Richard Levitte <richard@levitte.org>
 | 
			
		||||
--
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
--
 | 
			
		||||
-- InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
-- it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
-- ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
-- This file is part of InDefero, an open source project management application.
 | 
			
		||||
-- Copyright (C) 2011 Céondo Ltd and contributors.
 | 
			
		||||
-- Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
--
 | 
			
		||||
-- InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
-- it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
@@ -233,6 +233,29 @@ class IDF_Project extends Pluf_Model
 | 
			
		||||
        return $tags;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a list of relations which are available in this project as
 | 
			
		||||
     * associative array. Each key-value pair marks a set of orthogonal
 | 
			
		||||
     * relations. To ease processing, each of these pairs is included twice
 | 
			
		||||
     * in the array, once as key1 => key2 and once as key2 => key1.
 | 
			
		||||
     *
 | 
			
		||||
     * @return array List of relation names
 | 
			
		||||
     */
 | 
			
		||||
    public function getRelationsFromConfig()
 | 
			
		||||
    {
 | 
			
		||||
        $conf = $this->getConf();
 | 
			
		||||
        $rel = $conf->getVal('issue_relations', IDF_Form_IssueTrackingConf::init_relations);
 | 
			
		||||
        $relations = array();
 | 
			
		||||
        foreach (preg_split("/\015\012|\015|\012/", $rel, -1, PREG_SPLIT_NO_EMPTY) as $s) {
 | 
			
		||||
            $verbs = preg_split("/\s*,\s*/", $s, 2);
 | 
			
		||||
            if (count($verbs) == 1)
 | 
			
		||||
                $relations += array($verbs[0] => $verbs[0]);
 | 
			
		||||
            else
 | 
			
		||||
                $relations += array($verbs[0] => $verbs[1], $verbs[1] => $verbs[0]);
 | 
			
		||||
        }
 | 
			
		||||
        return $relations;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Return membership data.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
/*
 | 
			
		||||
# ***** BEGIN LICENSE BLOCK *****
 | 
			
		||||
# This file is part of InDefero, an open source project management application.
 | 
			
		||||
# Copyright (C) 2008 Céondo Ltd and contributors.
 | 
			
		||||
# Copyright (C) 2008-2011 Céondo Ltd and contributors.
 | 
			
		||||
#
 | 
			
		||||
# InDefero is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user