[Fusionforge-commits] r15461 - in branches/Branch_5_2/src: common/docman/include www/docman

Franck VILLAUME nerville at fusionforge.org
Sat May 5 13:32:34 CEST 2012


Author: nerville
Date: 2012-05-05 13:32:33 +0200 (Sat, 05 May 2012)
New Revision: 15461

Modified:
   branches/Branch_5_2/src/common/docman/include/utils.php
   branches/Branch_5_2/src/www/docman/view.php
Log:
port from branch 5.1: fix dirname and filename due to ZipArchive limitations & extend to new features

Modified: branches/Branch_5_2/src/common/docman/include/utils.php
===================================================================
--- branches/Branch_5_2/src/common/docman/include/utils.php	2012-05-05 11:22:35 UTC (rev 15460)
+++ branches/Branch_5_2/src/common/docman/include/utils.php	2012-05-05 11:32:33 UTC (rev 15461)
@@ -53,14 +53,14 @@
 function docman_fill_zip($zip, $nested_groups, $document_factory, $docgroup = 0, $parent_docname = '') {
 	if (is_array(@$nested_groups[$docgroup])) {
 		foreach ($nested_groups[$docgroup] as $dg) {
-			if (!$zip->addEmptyDir($parent_docname.'/'.$dg->getName()))
+			if (!$zip->addEmptyDir(iconv("UTF-8", "ASCII//TRANSLIT", $parent_docname).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $dg->getName())))
 				return false;
 
 			$document_factory->setDocGroupID($dg->getID());
 			$docs = $document_factory->getDocuments(1);	// no caching
 			if (is_array($docs) && count($docs) > 0) {	// this group has documents
 				foreach ($docs as $doc) {
-					if ( !$zip->addFromString($parent_docname.'/'.$dg->getName().'/'.$doc->getFileName(),$doc->getFileData()))
+					if (!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $parent_docname).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $dg->getName()).'/'.iconv("UTF-8", "ASCII//TRANSLIT", $doc->getFileName()), $doc->getFileData()))
 						return false;
 				}
 			}


Property changes on: branches/Branch_5_2/src/common/docman/include/utils.php
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/Branch_4_7/gforge/common/docman/include/utils.php:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179,7203,7205,7207,7210,7212,7251-7253,7255,7284,7287,7291,7293,7295-7296,7300,7355,7365-7366,7375-7376,7378,7395,7423-7426,7435,7458,7504,7567,7577,7623-7624,7638,7659-7660,7662,7665,7668,7674,7699,7746-7748,7771,7774,7786,7838
/branches/Branch_4_8/gforge/common/docman/include/utils.php:7334-7335,7344-7345,7382,7387,7389-7390,7396,7398,7401-7402,7428-7429,7437,7440,7443,7449-7455,7459,7462,7466,7469-7470,7476-7478,7480,7485,7490-7492,7505,7540,7556-7560,7568,7570-7571,7573,7576,7580,7609-7611,7613,7615,7618,7621-7622,7625-7627,7639,7658,7661,7663-7664,7666-7667,7673,7675,7678,7680,7685,7688-7689,7693,7700,7706-7708,7713,7725,7728-7742,7760,7763-7764,7767,7769-7770,7773,7776,7784-7785,7791,7797,7799,7802-7808,7810-7811,7816,7818,7825-7828,7839,7846-7847,7850,7894,7902,7920-7922,7927-7928,7932,7936-7937,7939,7942,7944-7945,7947,7951,7956,7958,7960,8064,8079-8080,8108,8113,8119,8121,8127-8128,8145,8197,8201-8202,8216,8224,8226,8228,8247-8250,8252,8271-8272,8310-8311,8328,8337,8339-8357,8361,8371,8373-8375,8378-8379,8383-8396,8415,8427-8431,8438-8441,8449,8452-8453,8458,8461,8477-8478,8480,8482,8492,8514,8530,8604-8605,8608,8637,8704-8754
/branches/Branch_5_1/src/common/docman/include/utils.php:11585-13625
/branches/Branch_5_1/src/common/include/utils.php:15081-15460
/trunk/gforge/common/docman/include/utils.php:8721-8727

Modified: branches/Branch_5_2/src/www/docman/view.php
===================================================================
--- branches/Branch_5_2/src/www/docman/view.php	2012-05-05 11:22:35 UTC (rev 15460)
+++ branches/Branch_5_2/src/www/docman/view.php	2012-05-05 11:32:33 UTC (rev 15461)
@@ -190,7 +190,7 @@
 				$docs = $df->getDocuments(1);	// no caching
 				if (is_array($docs) && count($docs) > 0) {	// this group has documents
 					foreach ($docs as $doc) {
-						if (!$zip->addFromString($doc->getFileName(), $doc->getFileData()))
+						if (!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $doc->getFileName()), $doc->getFileData()))
 							exit_error(_('Unable to fill zipfile.'), 'docman');
 					}
 				}
@@ -233,7 +233,7 @@
 						exit_error($d->getErrorMessage(), 'docman');
 					}
 
-					if (!$zip->addFromString($d->getFileName(), $d->getFileData()))
+					if (!$zip->addFromString(iconv("UTF-8", "ASCII//TRANSLIT", $d->getFileName()), $d->getFileData()))
 						exit_error(_('Unable to fill zipfile.'), 'docman');
 				} else {
 					$zip->close();




More information about the Fusionforge-commits mailing list