Esempio n. 1
0
 function form_collectinfo()
 {
     $cancelUrl = $this->getReturnUrl();
     $oForm = new KTForm();
     $oForm->setOptions(array('identifier' => 'ktcore.actions.bulk.copy.form', 'label' => _kt('Copy Items'), 'submit_label' => _kt('Copy'), 'action' => 'performaction', 'fail_action' => 'collectinfo', 'cancel_url' => $cancelUrl, 'context' => $this));
     // Setup the collection for move display.
     require_once KT_LIB_DIR . '/browse/DocumentCollection.inc.php';
     $collection = new AdvancedCollection();
     $oCR =& KTColumnRegistry::getSingleton();
     $col = $oCR->getColumn('ktcore.columns.title');
     //$col->setOptions(array('qs_params'=>array('fMoveCode'=>$sMoveCode,
     //                                          'fFolderId'=>$oFolder->getId(),
     //                                          'action'=>'startMove')));
     $collection->addColumn($col);
     $qObj = new FolderBrowseQuery($this->oFolder->iId);
     $exclude = array();
     foreach ($this->oEntityList->aFolderIds as $folderid) {
         $exclude[] = $folderid + 0;
     }
     $qObj->exclude_folders = $exclude;
     $collection->setQueryObject($qObj);
     $aOptions = $collection->getEnvironOptions();
     $aOptions['result_url'] = KTUtil::addQueryString($_SERVER['PHP_SELF'], array('fFolderId' => $this->oFolder->iId, 'action' => 'collectinfo'));
     $collection->setOptions($aOptions);
     $oWF =& KTWidgetFactory::getSingleton();
     $oWidget = $oWF->get('ktcore.widgets.collection', array('label' => _kt('Target Folder'), 'description' => _kt('Use the folder collection and path below to browse to the folder you wish to copy the documents into.'), 'required' => true, 'name' => 'fFolderId', 'broken_name' => true, 'folder_id' => $this->oFolder->iId, 'collection' => $collection));
     $oForm->addInitializedWidget($oWidget);
     // Electronic Signature if enabled
     global $default;
     if ($default->enableESignatures) {
         $oForm->addWidget(array('ktcore.widgets.info', array('label' => _kt('This action requires authentication'), 'description' => _kt('Please provide your user credentials as confirmation of this action.'), 'name' => 'info')));
         $oForm->addWidget(array('ktcore.widgets.string', array('label' => _kt('Username'), 'name' => 'sign_username', 'required' => true)));
         $oForm->addWidget(array('ktcore.widgets.password', array('label' => _kt('Password'), 'name' => 'sign_password', 'required' => true)));
     }
     $oForm->addWidget(array('ktcore.widgets.reason', array('name' => 'reason', 'label' => _kt('Reason'), 'description' => _kt('The reason for copying these documents and folders, for historical purposes.'), 'value' => null, 'required' => true)));
     $oForm->setValidators(array(array('ktcore.validators.string', array('test' => 'reason', 'output' => 'reason'))));
     if ($default->enableESignatures) {
         $oForm->addValidator(array('electonic.signatures.validators.authenticate', array('object_id' => $this->oFolder->getID(), 'type' => 'bulk', 'action' => 'ktcore.transactions.bulk_copy', 'test' => 'info', 'output' => 'info')));
     }
     return $oForm;
 }