Commit 6e4e74a48813ffd6d6cd7b1340733c4d578d2231

Authored by Paul Barrett
2 parents 4c9c1962 45f8547e

Merge branch 'edge' of github.com:ktgit/knowledgetree into edge

lib/foldermanagement/compressionArchiveUtil.inc.php
... ... @@ -668,9 +668,10 @@ class DownloadQueue
668 668 *
669 669 * @param unknown_type $zip
670 670 * @param unknown_type $docId
  671 + * @param boolean $alerts
671 672 * @return unknown
672 673 */
673   - public function addDocument(&$zip, $docId)
  674 + public function addDocument(&$zip, $docId, $alerts = true)
674 675 {
675 676  
676 677 $oDocument = Document::get($docId);
... ... @@ -685,7 +686,7 @@ class DownloadQueue
685 686 }
686 687  
687 688 // fire subscription alerts for the downloaded document - if global config is set
688   - if($this->bNotifications){
  689 + if($this->bNotifications && $alerts){
689 690 $oSubscriptionEvent = new SubscriptionEvent();
690 691 $oFolder = Folder::get($oDocument->getFolderID());
691 692 $oSubscriptionEvent->DownloadDocument($oDocument, $oFolder);
... ...
plugins/ktcore/KTBulkActions.php
... ... @@ -1194,7 +1194,6 @@ class KTBrowseBulkExportAction extends KTBulkAction {
1194 1194 *
1195 1195 */
1196 1196 function perform_action($oEntity) {
1197   - // TODO find a way to do bulk email
1198 1197 $exportCode = $_SESSION['exportcode'];
1199 1198 $this->oZip = ZipFolder::get($exportCode);
1200 1199  
... ... @@ -1213,7 +1212,7 @@ class KTBrowseBulkExportAction extends KTBulkAction {
1213 1212 if($useQueue){
1214 1213 DownloadQueue::addItem($this->sExportCode, $this->oFolder->getId(), $oDocument->iId, 'document');
1215 1214 }else{
1216   - $oQueue->addDocument($this->oZip, $oDocument->iId);
  1215 + $oQueue->addDocument($this->oZip, $oDocument->iId, false);
1217 1216 }
1218 1217  
1219 1218  
... ...
plugins/ktcore/admin/manageBranding.php
... ... @@ -96,10 +96,11 @@ class ManageBrandDispatcher extends KTAdminDispatcher {
96 96 'encoding' => 'multipart/form-data',
97 97 'context' => &$this,
98 98 'extraargs' => $this->meldPersistQuery("","",true),
99   - 'description' => _kt('You can set the branding details.')
  99 + 'description' => _kt('You can set the branding details.')
100 100 ));
101 101  
102 102 $oWF =& KTWidgetFactory::getSingleton();
  103 + $oVF =& KTValidatorFactory::getSingleton();
103 104  
104 105 $widgets = array();
105 106 $validators = array();
... ... @@ -126,6 +127,13 @@ class ManageBrandDispatcher extends KTAdminDispatcher {
126 127 'value' => $logoUrl,
127 128 'description' => _kt("This is the website address you will be redirected to after clicking the logo. The url should include the protocol e.g. http://www.knowledgetree.com . If no protocol is given the url is treated as a relative link."),
128 129 ));
  130 +
  131 +
  132 + // Adding the url widget
  133 + $validators[] = $oVF->get('ktcore.widgets.string', array(
  134 + 'test' => 'logo_url',
  135 + 'output' => 'logo_url',
  136 + ));
129 137  
130 138 $oForm->setWidgets($widgets);
131 139 $oForm->setValidators($validators);
... ... @@ -428,9 +436,6 @@ class ManageBrandDispatcher extends KTAdminDispatcher {
428 436  
429 437 return $oForm;
430 438 }
431   -
432   -
433   -
434 439  
435 440 /*
436 441 * Action responsible for setting the logo details
... ... @@ -443,12 +448,12 @@ class ManageBrandDispatcher extends KTAdminDispatcher {
443 448 $config =& KTConfig::getSingleton();
444 449 $logoUrl = $_REQUEST['data']['logo_url'];
445 450 $logoTitle = $_REQUEST['data']['logo_title'];
  451 +
  452 + $aOptions = array('redirect_to' => 'main');
446 453  
447   - if(!preg_match('/([a-z])|([A-Z])|([0-9])/', $logoTitle)){
448   - $this->errorRedirectTo('main', _kt("You have entered an invalid character in the logo title. You may use only letters and numbers."));
  454 + if ($logoTitle != '') {
  455 + $this->oValidator->validateIllegalCharacters($logoTitle, $aOptions);
449 456 }
450   -
451   - $logoTitle = addslashes(htmlentities($logoTitle));
452 457  
453 458 if ($config->set('ui/companyLogoUrl', $logoUrl) && $config->set('ui/companyLogoTitle', $logoTitle)) {
454 459 $this->successRedirectTo('main', _kt('Logo fields have been successfully updated.'));
... ... @@ -458,8 +463,6 @@ class ManageBrandDispatcher extends KTAdminDispatcher {
458 463  
459 464 }
460 465  
461   -
462   -
463 466 /*
464 467 * Action responsible for uploading the logo
465 468 *
... ...
sql/mysql/install/data.sql
... ... @@ -1781,7 +1781,8 @@ INSERT INTO `upgrades` VALUES
1781 1781 (235,'sql*3.7.0.3*0*3.7.0.3/clienttools_config.sql','Database upgrade to version 3.7.0.3: Clienttools Config','2009-12-10 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3'),
1782 1782 (236,'sql*3.7.0.3*0*3.7.0.3/uploaded_files.sql','Database upgrade to version 3.7.0.3: Uploaded Files','2009-12-10 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3'),
1783 1783 (237,'sql*3.7.0.3*0*3.7.0.3/active_sessions_ip.sql','Database upgrade to version 3.7.0.3: Active Sessions Ip','2009-12-10 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3'),
1784   -(238,'upgrade*3.7.0.3*99*upgrade3.7.0.3','Upgrade from version 3.7.0.2 to 3.7.0.3','2009-12-14 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3');
  1784 +(238,'sql*3.7.0.3*0*3.7.0.3/download_queue_zip.sql','Database upgrade to version 3.7.0.3: Download Queue Zip','2009-12-10 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3'),
  1785 +(239,'upgrade*3.7.0.3*99*upgrade3.7.0.3','Upgrade from version 3.7.0.2 to 3.7.0.3','2009-12-14 00:00:00',1,'upgrade*3.7.0.3*99*upgrade3.7.0.3');
1785 1786 /*!40000 ALTER TABLE `upgrades` ENABLE KEYS */;
1786 1787 UNLOCK TABLES;
1787 1788  
... ...