public function executeIndex()
 {
     wfProfileIn(__METHOD__);
     $licenses = new Licenses(array('id' => 'wpLicense', 'name' => 'wpLicense', 'fieldname' => 'wpLicense'));
     $this->licensesHtml = $licenses->getInputHTML(null);
     wfProfileOut(__METHOD__);
 }
Ejemplo n.º 2
0
 public function execute()
 {
     $params = $this->extractRequestParams();
     try {
         $licenses = new Licenses($params);
     } catch (Exception $e) {
         $this->dieUsageMsg('Invalid name or id');
     }
     $selected = isset($params['default']) ? $params['default'] : null;
     $this->getResult()->addValue(null, $this->getModuleName(), array('html' => $licenses->getInputHTML($selected)));
 }
Ejemplo n.º 3
0
 /**
  * Setup pages
  */
 private function setup_pages()
 {
     // Admin License Page
     $page_license = new Licenses();
     $page_license->setup();
     // Admin Activations Page
     $page_activations = new Activations();
     $page_activations->setup();
     // Admin Add License Page
     $page_add_license = new AddLicense();
     $page_add_license->setup();
 }
Ejemplo n.º 4
0
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload;
     global $wgStylePath;
     // dont show all of the skin
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     $sk = $wgUser->getSkin();
     $sourcefilename = wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsg('imagepopup_summary');
     $addtosection = wfMsg('imageuploadsection');
     $cp = wfMsg('imageuploadcaption');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $articlesummary = wfMsg('summary');
     $steps = wfMsg('steps');
     $tips = wfMsg('tips');
     $warnings = wfMsg('warnings');
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = Title::makeTitle(NS_SPECIAL, 'UploadPopup');
     $action = $titleObj->escapeLocalURL();
     $encDestFile = htmlspecialchars($this->mDestFile);
     $watchChecked = $wgUser->getOption('watchdefault') ? 'checked="checked"' : '';
     $wgOut->addHTML("\n            <script type='text/javascript'>\n                function checkFFBug() {\n                    if ((document.uploadform.wpLicense.value == '' || document.uploadform.wpLicense.value == 'No License' ) \n                        && navigator.userAgent.toLowerCase().indexOf('firefox') >= 0) { \n                        return confirm('" . wfMsg('no_license_selected') . "'); \n                    }\n                    return true;\n            }\n            </script>\n\t<form id='upload' name='uploadform' method='post' enctype='multipart/form-data' action=\"{$action}\" onsubmit='return checkFFBug();'>\n\t\t<table border='0'>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t</tr>\n\t      <tr>\n            <td align='right'><label for='wpAddToSection'>{$addtosection}:</label></td>\n            <td align='left'>\n        \t\t<SELECT name=wpAddToSection tabindex='3'>\n       \t\t\t  <OPTION VALUE=summary>{$articlesummary}</OPTION>\n        \t\t\t<OPTION VALUE=steps>{$steps}</OPTION>\n        \t\t\t<OPTION VALUE=tips>{$tips}</OPTION>\n        \t\t\t<OPTION VALUE=warnings>{$warnings}</OPTION>\n        \t\t</SELECT>#:<input type=text size=2 name=wpStepNum>\n            </td>\n        </tr>\n    \t<tr>\n            <td align='right'><label for='wpCaption'>{$cp}:</label></td>\n            <td align='left'>\n        \t\t\t<input tabindex='4' type='text' name=\"wpCaption\" size='40'\"/>\n        \t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadDescription'>{$summary}</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='5' type='text' name='wpUploadDescription' id='wpUploadDescription' size='40' value=\"" . htmlspecialchars($this->mUploadDescription) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>");
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wpLicense'>{$license}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<script type='text/javascript' src=\"" . wfGetPad('/extensions/min/f/skins/common/upload.js') . "\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='6'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     $wgOut->addHtml("\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthis') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'><input id='gatWPUploadPopup' tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>\n\n<script type='text/javascript'>\nvar gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');\ndocument.write(unescape('%3Cscript src=\\'' + gaJsHost + 'google-analytics.com/ga.js\\' type=\\'text/javascript\\'%3E%3C/script%3E'));    \n\ntry {       \nvar pageTracker = _gat._getTracker('UA-2375655-1'); \npageTracker._setDomainName('.wikihow.com');} catch(err) {}\n\nif (typeof jQuery == 'undefined') {\n\tEvent.observe(window, 'load', gatStartObservers); \n} else {\n\tjQuery(window).load(gatStartObservers);\n}\n</script> ");
 }
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser, $wgLang, $wgMaxUploadSize;
     global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
     global $wgRequest, $wgAllowCopyUploads;
     global $wgStylePath, $wgStyleVersion;
     $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
     $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview;
     $adc = wfBoolToStr($useAjaxDestCheck);
     $alp = wfBoolToStr($useAjaxLicensePreview);
     $autofill = wfBoolToStr($this->mDesiredDestName == '');
     $wgOut->addScript("<script type=\"text/javascript\">\nwgAjaxUploadDestCheck = {$adc};\nwgAjaxLicensePreview = {$alp};\nwgUploadAutoFill = {$autofill};\n</script>\n<script type=\"text/javascript\" src=\"{$wgStylePath}/common/upload.js?{$wgStyleVersion}\"></script>\n\t\t");
     if (!wfRunHooks('UploadForm:initial', array(&$this))) {
         wfDebug("Hook 'UploadForm:initial' broke output of the upload form");
         return false;
     }
     if ($this->mDesiredDestName) {
         $title = Title::makeTitleSafe(NS_IMAGE, $this->mDesiredDestName);
         // Show a subtitle link to deleted revisions (to sysops et al only)
         if ($title instanceof Title && ($count = $title->isDeleted()) > 0 && $wgUser->isAllowed('deletedhistory')) {
             $link = wfMsgExt($wgUser->isAllowed('delete') ? 'thisisdeleted' : 'viewdeleted', array('parse', 'replaceafter'), $wgUser->getSkin()->makeKnownLinkObj(SpecialPage::getTitleFor('Undelete', $title->getPrefixedText()), wfMsgExt('restorelink', array('parsemag', 'escape'), $count)));
             $wgOut->addHtml("<div id=\"contentSub2\">{$link}</div>");
         }
         // Show the relevant lines from deletion log (for still deleted files only)
         if ($title instanceof Title && $title->isDeleted() > 0 && !$title->exists()) {
             $this->showDeletionLog($wgOut, $title->getPrefixedText());
         }
     }
     $cols = intval($wgUser->getOption('cols'));
     if ($wgUser->getOption('editwidth')) {
         $width = " style=\"width:100%\"";
     } else {
         $width = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     //$wgOut->addHTML( '<div id="uploadtext">' );
     //$wgOut->addWikiMsg( 'uploadtext', $this->mDesiredDestName );
     //$wgOut->addHTML( "</div>\n" );
     # Print a list of allowed file extensions, if so configured.  We ignore
     # MIME type here, it's incomprehensible to most people and too long.
     global $wgCheckFileExtensions, $wgStrictFileExtensions, $wgFileExtensions, $wgFileBlacklist;
     $allowedExtensions = '';
     if ($wgCheckFileExtensions) {
         $delim = wfMsgExt('comma-separator', array('escapenoentities'));
         if ($wgStrictFileExtensions) {
             # Everything not permitted is banned
             $extensionsList = '<div id="mw-upload-permitted">' . wfMsgWikiHtml('upload-permitted', implode($wgFileExtensions, $delim)) . "</div>\n";
         } else {
             # We have to list both preferred and prohibited
             $extensionsList = '<div id="mw-upload-preferred">' . wfMsgWikiHtml('upload-preferred', implode($wgFileExtensions, $delim)) . "</div>\n" . '<div id="mw-upload-prohibited">' . wfMsgWikiHtml('upload-prohibited', implode($wgFileBlacklist, $delim)) . "</div>\n";
         }
     }
     # Get the maximum file size from php.ini as $wgMaxUploadSize works for uploads from URL via CURL only
     # See http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize for possible values of upload_max_filesize
     $val = trim(ini_get('upload_max_filesize'));
     $last = strtoupper(substr($val, -1));
     switch ($last) {
         case 'G':
             $val2 = substr($val, 0, -1) * 1024 * 1024 * 1024;
             break;
         case 'M':
             $val2 = substr($val, 0, -1) * 1024 * 1024;
             break;
         case 'K':
             $val2 = substr($val, 0, -1) * 1024;
             break;
         default:
             $val2 = $val;
     }
     $val2 = $wgAllowCopyUploads ? min($wgMaxUploadSize, $val2) : $val2;
     $maxUploadSize = wfMsgExt('upload-maxfilesize', array('parseinline', 'escapenoentities'), $wgLang->formatSize($val2));
     $sourcefilename = wfMsgExt('sourcefilename', 'escapenoentities');
     $destfilename = wfMsgExt('destfilename', 'escapenoentities');
     $summary = wfMsgExt('fileuploadsummary', 'parseinline');
     $licenses = new Licenses();
     $license = wfMsgExt('license', array('parseinline'));
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = SpecialPage::getTitleFor('Mv_special_upload');
     $encDestName = htmlspecialchars($this->mDesiredDestName);
     $watchChecked = $this->watchCheck() ? 'checked="checked"' : '';
     $warningChecked = $this->mIgnoreWarning ? 'checked' : '';
     // Prepare form for upload or upload/copy
     if ($wgAllowCopyUploads && $wgUser->isAllowed('upload_by_url')) {
         $filename_form = "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' " . "onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked='checked' />" . "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . "onfocus='" . "toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\");" . "toggle_element_check(\"wpSourceTypeFile\",\"wpSourceTypeURL\")' " . "onchange='fillDestFilename(\"wpUploadFile\")' size='60' />" . wfMsgHTML('upload_source_file') . "<br/>" . "<input type='radio' id='wpSourceTypeURL' name='wpSourceType' value='web' " . "onchange='toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\")' />" . "<input tabindex='1' type='text' name='wpUploadFileURL' id='wpUploadFileURL' " . "onfocus='" . "toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\");" . "toggle_element_check(\"wpSourceTypeURL\",\"wpSourceTypeFile\")' " . "onchange='fillDestFilename(\"wpUploadFileURL\")' size='60' disabled='disabled' />" . wfMsgHtml('upload_source_url');
     } else {
         $filename_form = "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDesiredDestName ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='60' />" . "<input type='hidden' name='wpSourceType' value='file' />";
     }
     if ($useAjaxDestCheck) {
         $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'>&nbsp;</td></tr>";
         $destOnkeyup = 'onkeyup="wgUploadWarningObj.keypress();"';
     } else {
         $warningRow = '';
         $destOnkeyup = '';
     }
     $encComment = htmlspecialchars($this->mComment);
     $wgOut->addHTML(Xml::openElement('form', array('method' => 'post', 'action' => $titleObj->getLocalURL(), 'enctype' => 'multipart/form-data', 'id' => 'mw-upload-form')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('upload')) . Xml::openElement('table', array('border' => '0', 'id' => 'mw-upload-table')) . "<tr>\n\t\t\t \t{$this->uploadFormTextTop}\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t<label for='wpUploadFile'>{$sourcefilename}</label>\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t{$filename_form}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t{$maxUploadSize}\n\t\t\t\t\t{$extensionsList}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t<label for='wpDestFile'>{$destfilename}</label>\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='60'\n\t\t\t\t\t\tvalue=\"{$encDestName}\" onchange='toggleFilenameFiller()' {$destOnkeyup} />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t<label for='file_desc_msg'>stream desc msg</label>\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t<input tabindex='3' type='text' name='file_desc_msg' id='file_desc_msg' size='60'\n\t\t\t\t\t\tvalue=\"mv_ogg_low_quality\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t<label for='wpUploadDescription'>{$summary}</label>\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t<textarea tabindex='4' name='wpUploadDescription' id='wpUploadDescription' rows='6'\n\t\t\t\t\t\tcols='{$cols}'{$width}>{$encComment}</textarea>\n\t\t\t\t\t{$this->uploadFormTextAfterSummary}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>");
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t\t<label for='wpLicense'>{$license}</label>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='4'\n\t\t\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t\t\t{$licenseshtml}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>");
         if ($useAjaxLicensePreview) {
             $wgOut->addHtml("\n\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t<td id=\"mw-license-preview\"></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>");
         }
     }
     if ($wgUseCopyrightUpload) {
         $filestatus = wfMsgExt('filestatus', 'escapenoentities');
         $copystatus = htmlspecialchars($this->mCopyrightStatus);
         $filesource = wfMsgExt('filesource', 'escapenoentities');
         $uploadsource = htmlspecialchars($this->mCopyrightSource);
         $wgOut->addHTML("\n\t\t\t\t\t<td class='mw-label' style='white-space: nowrap;'>\n\t\t\t\t\t\t<label for='wpUploadCopyStatus'>{$filestatus}</label></td>\n\t\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t\t<input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus'\n\t\t\t\t\t\t\tvalue=\"{$copystatus}\" size='60' />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t\t<label for='wpUploadCopyStatus'>{$filesource}</label>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t\t<input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus'\n\t\t\t\t\t\t\tvalue=\"{$uploadsource}\" size='60' />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>");
     }
     $wgOut->addHtml("\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthisupload') . "</label>\n\t\t\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' {$warningChecked}/>\n\t\t\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t{$warningRow}\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t\t<input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey('upload') . " />\n\t\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td class='mw-input'>");
     //undesa
     $stream_id = $wgRequest->getVal('stream_id');
     $wgOut->addHTML("<input type=hidden name=stream_id value={$stream_id}></input>");
     //undesa
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t\t\t</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::hidden('wpDestFileWarningAck', '', array('id' => 'wpDestFileWarningAck')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
     $uploadfooter = wfMsgNoTrans('uploadfooter');
     if ($uploadfooter != '-' && !wfEmptyMsg('uploadfooter', $uploadfooter)) {
         $wgOut->addWikiText(Xml::tags('div', array('id' => 'mw-upload-footer-message'), $uploadfooter));
     }
 }
 function reDirect($getArr, $object = null)
 {
     $form_creator = new FormCreator($getArr);
     switch ($getArr['uniqcode']) {
         case 'BNK':
             $form_creator->formPath = '/templates/eimadmin/bankinformation.php';
             $bankinfo = new BankInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $bankinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $bankinfo->filterBankInfo($getArr['id']);
             }
             break;
         case 'BCH':
             $form_creator->formPath = '/templates/eimadmin/branches.php';
             $brch = new Branches();
             $bank = new BankInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $brch->getLastRecord();
                 $form_creator->popArr['bankcode'] = $bank->getBankCodes();
             } elseif ($getArr['captuIMPremode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $brch->filterBranches($getArr['id']);
                 $form_creator->popArr['bankcode'] = $bank->getBankCodes();
             }
             break;
         case 'TAX':
             $form_creator->formPath = '/templates/eimadmin/taxinformation.php';
             $taxinfo = new TaxInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $taxinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $taxinfo->filterTaxInfo($getArr['id']);
             }
             break;
         case 'CCB':
             $form_creator->formPath = '/templates/eimadmin/cashben.php';
             $cashben = new CashBen();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cashben->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cashben->filterCashBenefits($getArr['id']);
             }
             break;
         case 'BBS':
             $form_creator->formPath = '/templates/eimadmin/cashbensal.php';
             $salgrd = new SalaryGrades();
             $cashbensal = new CashBenSalary();
             $cashben = new CashBen();
             $form_creator->popArr['salDet'] = $salgrd->filterSalaryGrades($getArr['id']);
             $form_creator->popArr['benListAll'] = $cashben->getAllCashBenefits();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $cashbensal->filterCashBenefits($arr);
             } else {
                 $form_creator->popArr['benListUnAss'] = $cashben->getCashBenCodes($getArr['id']);
             }
             $form_creator->popArr['benListAss'] = $cashbensal->getAssCashBenefits($getArr['id']);
             break;
         case 'COS':
             $form_creator->formPath = '/templates/eimadmin/costcenters.php';
             $cost = new CostCenter();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cost->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cost->filterCostCenter($getArr['id']);
             }
             break;
         case 'COU':
             $form_creator->formPath = '/templates/eimadmin/countryinformation.php';
             $country = new CountryInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $country->filterCountryInfo($getArr['id']);
             }
             break;
         case 'CUR':
             $form_creator->formPath = '/templates/eimadmin/currencytypes.php';
             $currency = new CurrencyTypes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $currency->filterCurrencyTypes($getArr['id']);
             }
             break;
         case 'DWT':
             $form_creator->formPath = '/templates/eimadmin/dwellinginformation.php';
             $dwinfo = new DwellingType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $dwinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $dwinfo->filterDwellingType($getArr['id']);
             }
             break;
         case 'ELE':
             $form_creator->formPath = '/templates/eimadmin/electorateinformation.php';
             $eleinfo = new ElectorateInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $eleinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $eleinfo->filterElectorateInfo($getArr['id']);
             }
             break;
         case 'EMC':
             $form_creator->formPath = '/templates/eimadmin/empcatinfo.php';
             $empcatinfo = new EmployeeCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empcatinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empcatinfo->filterEmployeeCat($getArr['id']);
             }
             break;
         case 'EMG':
             $form_creator->formPath = '/templates/eimadmin/employeegroups.php';
             $empgrpinfo = new EmployeeGroup();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empgrpinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empgrpinfo->filterEmployeeGroup($getArr['id']);
             }
             break;
         case 'ETY':
             $form_creator->formPath = '/templates/eimadmin/emptypes.php';
             $emptype = new EmployeeType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $emptype->getLastRecord();
             } elseif ($getArr['capturemIMPode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $emptype->filterEmployeeType($getArr['id']);
             }
             break;
         case 'EXC':
             $form_creator->formPath = '/templates/eimadmin/extracurractcat.php';
             $exccat = new ExtraCurrActCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $exccat->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $exccat->filterExtraCurrActCat($getArr['id']);
             }
             break;
         case 'DEF':
             $form_creator->formPath = '/templates/eimadmin/hierarchydef.php';
             $hidef = new HierarchyDefInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $hidef->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $hidef->filterHierarchyDefInfo($getArr['id']);
             }
             break;
         case 'CHI':
             $form_creator->formPath = '/templates/eimadmin/comphier.php';
             $cmphier = new CompHierachy();
             $hidef = new HierarchyDefInfo();
             $loc = new models_eimadmin_Location();
             $empinfo = new EmpInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $cmphier->getLastRecord();
                 $form_creator->popArr['hiercodes'] = $hidef->getHierachyCodes();
                 $form_creator->popArr['empcodes'] = $empinfo->getEmpCodes();
                 $form_creator->popArr['deflev'] = $cmphier->getHierachyDef();
                 $form_creator->popArr['loccodes'] = $loc->getLocCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $cmphier->filterCompHierachy($getArr['id']);
                 $form_creator->popArr['hiercodes'] = $cmphier->getHierachyCodes();
                 $form_creator->popArr['empcodes'] = $empinfo->getEmpCodes();
                 $form_creator->popArr['deflev'] = $cmphier->getHierachyDef();
                 $form_creator->popArr['loccodes'] = $loc->getLocCodes();
             }
             break;
         case 'LOC':
             $form_creator->formPath = '/templates/eimadmin/locations.php';
             $loc = new models_eimadmin_Location();
             $country = new CountryInfo();
             $form_creator->popArr['cntlist'] = $country->getCountryCodes();
             if ($getArr['capturemode'] == 'updatemode') {
                 $province = new ProvinceInfo();
                 $district = new DistrictInfo();
                 $form_creator->popArr['editArr'] = $edit = $loc->filterLocation($getArr['id']);
                 $form_creator->popArr['provlist'] = $province->getProvinceCodes($edit[0][2]);
                 $form_creator->popArr['districtlist'] = $district->getDistrictCodes($edit[0][3]);
             }
             break;
         case 'JDC':
             $form_creator->formPath = '/templates/eimadmin/jdcategory.php';
             $jdcat = new JDCategory();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdcat->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdcat->filterJDCategory($getArr['id']);
             }
             break;
         case 'MEM':
             $form_creator->formPath = '/templates/eimadmin/membershiptypes.php';
             $memtype = new MembershipType();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $memtype->filterMembershipType($getArr['id']);
             }
             break;
         case 'EMX':
             $form_creator->formPath = '/templates/eimadmin/emailConfiguration.php';
             $emailConfigObj = new EmailConfiguration();
             $form_creator->popArr['editArr'] = $emailConfigObj;
             break;
         case 'CSE':
             $form_creator->formPath = '/templates/eimadmin/dataExport.php';
             $csvExport = new CSVExport();
             $form_creator->popArr['exportTypes'] = $csvExport->getDefinedExportTypes();
             break;
         case 'IMP':
             if (isset($getArr['upload']) && $getArr['upload'] == 1) {
                 $form_creator->formPath = '/templates/eimadmin/dataUploadStatus.php';
                 $form_creator->popArr['uploadStatus'] = $object;
                 $form_creator->popArr['recordLimit'] = CSVSplitter::getRecordLimit();
                 $form_creator->popArr['delimiterLevels'] = AjaxCalls::getDelimiterLevelsArray(3);
             } else {
                 $form_creator->formPath = '/templates/eimadmin/dataImport.php';
                 $csvImport = new CSVImport();
                 $form_creator->popArr['importTypes'] = $csvImport->getDefinedImportTypes();
             }
             break;
         case 'ENS':
             $form_creator->formPath = '/templates/eimadmin/emailNotificationConfiguration.php';
             $emailNotificationConfObj = new EmailNotificationConfiguration($_SESSION['user']);
             $form_creator->popArr['editArr'] = $emailNotificationConfObj->fetchNotifcationStatus();
             break;
         case 'NAT':
             $form_creator->formPath = '/templates/eimadmin/nationalityinformation.php';
             $natinfo = new NationalityInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $natinfo->filterNationalityInfo($getArr['id']);
             }
             break;
         case 'NCB':
             $form_creator->formPath = '/templates/eimadmin/noncashben.php';
             $noncashben = new NonCashBen();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $noncashben->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $noncashben->filterNonCashBenefits($getArr['id']);
             }
             break;
         case 'QLF':
             $form_creator->formPath = '/templates/eimadmin/qualificationtypes.php';
             $qualtype = new QualificationType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $qualtype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $qualtype->filterQualificationType($getArr['id']);
             }
             break;
         case 'RTM':
             $form_creator->formPath = '/templates/eimadmin/ratingmethods.php';
             $rattype = new RatingTypes();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $rattype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $rattype->filterRatingTypes($getArr['id']);
             }
             break;
         case 'RTE':
             $form_creator->formPath = '/templates/eimadmin/routeinformation.php';
             $rouinfo = new RouteInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $rouinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $rouinfo->filterRouteInfo($getArr['id']);
             }
             break;
         case 'SGR':
             $form_creator->formPath = '/templates/eimadmin/salarygrades.php';
             $salgrade = new SalaryGrades();
             $salcurdet = new SalCurDet();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $salgrade->filterSalaryGrades($getArr['id']);
                 $form_creator->popArr['assCurrency'] = $salcurdet->getAssSalCurDet($getArr['id']);
                 if (!isset($getArr['editID'])) {
                     $form_creator->popArr['unAssCurrency'] = $salcurdet->getUnAssSalCurDet($getArr['id']);
                 } else {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['editID'];
                     $form_creator->popArr['editAssCurrency'] = $salcurdet->filterSalCurDet($arr);
                 }
             }
             break;
         case 'SKI':
             $form_creator->formPath = '/templates/eimadmin/skills.php';
             $skill = new Skills();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $skill->filterSkills($getArr['id']);
             }
             break;
         case 'ETH':
             $form_creator->formPath = '/templates/eimadmin/ethnicrace.php';
             $ethnicrace = new EthnicRace();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $ethnicrace->filterEthnicRace($getArr['id']);
             }
             break;
         case 'EXA':
             $form_creator->formPath = '/templates/eimadmin/extracurractinfo.php';
             $extcainfo = new ExtraCurActInfo();
             $excurac = new ExtraCurrActCat();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $extcainfo->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $extcainfo->getExtraCatCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $extcainfo->filterExtraCurActInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             }
             break;
         case 'MME':
             $form_creator->formPath = '/templates/eimadmin/membershipinformation.php';
             $meminfo = new MembershipInfo();
             $memtype = new MembershipType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['getResultSet'] = $memtype->getMembershipTypeCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $meminfo->filterMembershipInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $memtype->getMembershipTypeCodes();
             }
             break;
         case 'JDK':
             $form_creator->formPath = '/templates/eimadmin/jdkra.php';
             $jdkr = new JDKra();
             $skill = new Skills();
             $jdtyp = new JDType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdkr->getLastRecord();
                 $form_creator->popArr['jdktyplist'] = $jdtyp->getJDTypeCodes();
                 $form_creator->popArr['sktyplist'] = $skill->getSkillCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdkr->filterJDKra($getArr['id']);
                 $form_creator->popArr['jdktyplist'] = $jdtyp->getJDTypeCodes();
                 $form_creator->popArr['sktyplist'] = $skill->getSkillCodes();
             }
             break;
         case 'LAN':
             $form_creator->formPath = '/templates/eimadmin/languageinformation.php';
             $laninfo = new LanguageInfo();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $laninfo->filterLanguageInfo($getArr['id']);
             }
             break;
         case 'RLG':
             $form_creator->formPath = '/templates/eimadmin/religioninformation.php';
             $relinfo = new ReligionInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $relinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $relinfo->filterReligionInfo($getArr['id']);
             }
             break;
         case 'SAT':
             $form_creator->formPath = '/templates/eimadmin/satutoryinfo.php';
             $satinfo = new SatutoryInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $satinfo->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $satinfo->filterSatutoryInfo($getArr['id']);
             }
             break;
         case 'UNI':
             $form_creator->formPath = '/templates/eimadmin/uniformtypes.php';
             $unitype = new UniformType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $unitype->getLastRecord();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $unitype->filterUniformType($getArr['id']);
             }
             break;
         case 'EXA':
             $form_creator->formPath = '/templates/eimadmin/extracurractinfo.php';
             $excurac = new ExtraCurActInfo();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $excurac->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $excurac->filterExtraCurActInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $excurac->getExtraCatCodes();
             }
             break;
         case 'EDU':
             $form_creator->formPath = '/templates/eimadmin/qualifications.php';
             $edu = new Education();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $edu->filterEducation($getArr['id']);
             }
             break;
         case 'JDT':
             $form_creator->formPath = '/templates/eimadmin/jdtypes.php';
             $jdtyp = new JDType();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $jdtyp->getLastRecord();
                 $form_creator->popArr['jdcatcodes'] = $jdtyp->getJDTypeCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jdtyp->filterJDType($getArr['id']);
                 $form_creator->popArr['jdcatcodes'] = $jdtyp->getJDTypeCodes();
             }
             break;
         case 'SBJ':
             $form_creator->formPath = '/templates/eimadmin/subjectinformation.php';
             $subin = new SubjectInfo();
             $qualifi = new Qualifications();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $subin->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $qualifi->getQualifiCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $subin->filterSubjectInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $qualifi->getQualifiCodes();
             }
             break;
         case 'SSK':
             $form_creator->formPath = '/templates/eimadmin/subskillinformation.php';
             $subsk = new SubSkillInfo();
             $skill = new Skills();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $subsk->getLastRecord();
                 $form_creator->popArr['getResultSet'] = $skill->getSkillCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $subsk->filterSubSkillInfo($getArr['id']);
                 $form_creator->popArr['getResultSet'] = $skill->getSkillCodes();
             }
             break;
         case 'CTT':
             $form_creator->formPath = '/templates/eimadmin/corptit.php';
             $corptit = new CorpTitle();
             $salgrd = new SalaryGrades();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $corptit->getLastRecord();
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['salgrds'] = $corptit->getSalGrades();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $corptit->filterCorpTitles($getArr['id']);
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['salgrds'] = $salgrd->getSalGrades();
             }
             break;
         case 'DSG':
             $form_creator->formPath = '/templates/eimadmin/designations.php';
             $desig = new Designations();
             $corptit = new CorpTitle();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $desig->getLastRecord();
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['des'] = $desig->getDes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $desig->filterDesignations($getArr['id']);
                 $form_creator->popArr['corptitles'] = $corptit->getCorpTitles();
                 $form_creator->popArr['des'] = $desig->getDes();
             }
             break;
         case 'DIS':
             $form_creator->formPath = '/templates/eimadmin/districtinformation.php';
             $disinfo = new DistrictInfo();
             $prov = new ProvinceInfo();
             $country = new CountryInfo();
             $form_creator->popArr['countrylist'] = $country->getCountryCodes();
             if ($getArr['capturemode'] == 'addmode') {
                 if ($object != null) {
                     $form_creator->popArr['txtDistrictDesc'] = $object->txtDistrictDesc;
                     $form_creator->popArr['cmbCountry'] = $object->cmbCountry;
                     $form_creator->popArr['selProvince'] = $object->selProvince;
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($object->cmbCountry);
                 }
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $editArr = $disinfo->filterDistrictInfo($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['txtDistrictDesc'] = $object->txtDistrictDesc;
                     $form_creator->popArr['cmbCountry'] = $object->cmbCountry;
                     $form_creator->popArr['selProvince'] = $object->selProvince;
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($object->cmbCountry);
                 } else {
                     $temp = $prov->filterGetProvinceCodeInfo($editArr[0][2]);
                     $form_creator->popArr['selcountry'] = $temp[0][2];
                     $form_creator->popArr['provlist'] = $prov->getProvinceCodes($temp[0][2]);
                 }
             }
             break;
         case 'NBS':
             $form_creator->formPath = '/templates/eimadmin/noncashbensal.php';
             $salgrd = new SalaryGrades();
             $noncashbensal = new NonCashBenSalary();
             $noncashben = new NonCashBen();
             $form_creator->popArr['salDet'] = $salgrd->filterSalaryGrades($getArr['id']);
             $form_creator->popArr['benListAll'] = $noncashben->getAllNonCashBenefits();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $noncashben->filterNonCashBenefits($arr);
             } else {
                 $form_creator->popArr['benListUnAss'] = $noncashben->getNonCashBenCodes($getArr['id']);
             }
             $form_creator->popArr['benListAss'] = $noncashbensal->getAssCashBenefits($getArr['id']);
             break;
         case 'DDI':
             $form_creator->formPath = '/templates/eimadmin/desdis.php';
             $desig = new Designations();
             $desdis = new DesDescription();
             $form_creator->popArr['desDet'] = $desig->getDes();
             $form_creator->popArr['desDisAss'] = $desdis->getAssigned($getArr['id']);
             if (isset($getArr['editID'])) {
                 $arr[1] = $getArr['id'];
                 $arr[0] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $desdis->filterJDKPI($arr);
             }
             if (isset($getArr['addForm']) && $getArr['addForm'] == 'ADD') {
                 $form_creator->popArr['desDisUnAss'] = $desdis->getGrouping($getArr['id']);
             }
             break;
         case 'DQA':
             $form_creator->formPath = '/templates/eimadmin/desqua.php';
             $desig = new Designations();
             $desqual = new DesQualification();
             $form_creator->popArr['desDet'] = $desig->getDes();
             $form_creator->popArr['qualListAll'] = $desqual->getAllQualifications();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $desqual->filterJDQual($arr);
             } else {
                 $form_creator->popArr['qualListUnAss'] = $desqual->getQual($getArr['id']);
             }
             $form_creator->popArr['qualListAss'] = $desqual->getAssJDQual($getArr['id']);
             break;
         case 'DQS':
             $form_creator->formPath = '/templates/eimadmin/desquasub.php';
             $desig = new Designations();
             $desqualsub = new DesQualSubject();
             $qualifi = new Qualifications();
             $form_creator->popArr['desDet'] = $desig->filterDesignations($getArr['id']);
             $form_creator->popArr['qualDet'] = $qualifi->getQualCodes();
             $form_creator->popArr['gradlist'] = $desqualsub->getRatGrds($getArr['QUA']);
             $form_creator->popArr['subDet'] = $desqualsub->getSubjectCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $arr[2] = $getArr['QUA'];
                 $form_creator->popArr['editArr'] = $desqualsub->filterQuaSub($arr);
             } else {
                 $form_creator->popArr['sublist'] = $desqualsub->getSubjects($getArr['id'], $getArr['QUA']);
             }
             $form_creator->popArr['rset'] = $desqualsub->getAssQuaSub($getArr['id']);
             break;
         case 'RTG':
             $form_creator->formPath = '/templates/eimadmin/ratinggrade.php';
             $rattyp = new RatingTypes();
             $form_creator->popArr['ratDet'] = $rattyp->filterRatingTypes($getArr['id']);
             $ratgrd = new RatingGrade();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $ratgrd->filterRatGrd($arr);
             } else {
                 $form_creator->popArr['newID'] = $ratgrd->getLastRecord();
             }
             $form_creator->popArr['ratGrdAss'] = $ratgrd->getAssRatGrd($getArr['id']);
             break;
         case 'EEC':
             $form_creator->formPath = '/templates/eimadmin/eeojobcat.php';
             $eeojobcat = new EEOJobCat();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $eeojobcat->filterEEOJobCat($getArr['id']);
             }
             break;
         case 'LIC':
             $form_creator->formPath = '/templates/eimadmin/licenses.php';
             $licenses = new Licenses();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $licenses->filterLicenses($getArr['id']);
             }
             break;
         case 'CST':
             $form_creator->formPath = '/templates/eimadmin/compstruct.php';
             /*
             $hierachinfo = new HierarchyDefInfo();
             $comphier = new CompHierachy();
             $compstruct = new CompStruct();
             
             $form_creator->popArr['hierlist'] = $hierachinfo -> getHierarchyDef();
             $form_creator->popArr['compstruct'] = $comphier ->getAssCompHier(1,'');
             $form_creator->popArr['unAssCompStruct'] = $compstruct->getUnAssCompStruct('',1);
             */
             $locations = new models_eimadmin_Location();
             $countries = new CountryInfo();
             $form_creator->popArr['locations'] = $locations->getLocCodes();
             $form_creator->popArr['countries'] = $countries->getCountryCodes();
             break;
         case 'TCP':
             $form_creator->formPath = '/templates/eimadmin/companyProperty.php';
             $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
             if (!isset($_GET['action'])) {
                 $empInfo = new EmpInfo();
                 if ($authorizeObj->isAdmin()) {
                     $form_creator->popArr['emplist'] = $empInfo->getListofEmployee();
                 } else {
                     $empReportTo = new EmpRepTo();
                     $form_creator->popArr['emplist'] = $empReportTo->getEmpSubDetails($_SESSION['empID']);
                     /* An element of the value from $empInfo->getListofEmployee() will contain
                      * an array with 6 elements. Values from $empReportTo->getEmpSubDetails() will
                      * only contain 3 elements. But there won't be a problem because only first 3 values
                      * will be used in the template
                      */
                 }
             }
             $compProp = new CompProperty();
             $propertyCount = count($compProp->getPropertyList());
             $pageNo = 1;
             if (isset($_REQUEST['pageNo'])) {
                 $pageNo = $_REQUEST['pageNo'];
             } else {
                 $pageNo = ceil($propertyCount / 10);
             }
             if ($authorizeObj->isAdmin()) {
                 $form_creator->popArr['properties'] = $compProp->getPropertyList($pageNo);
             } else {
                 $subordinateList = array();
                 foreach ($form_creator->popArr['emplist'] as $subordinate) {
                     $subordinateList[] = $subordinate[0];
                 }
                 $form_creator->popArr['properties'] = $compProp->getPropertyList($pageNo, $subordinateList, true);
             }
             $form_creator->popArr['allProperties'] = $compProp->getPropertyList();
             $form_creator->popArr['pageNo'] = $pageNo;
             $form_creator->popArr['recordCount'] = $propertyCount;
             $form_creator->popArr['authObj'] = $authorizeObj;
             break;
         case 'JOB':
             $form_creator->formPath = '/templates/eimadmin/jobtitle.php';
             $jobtitle = new JobTitle();
             $paygrade = new SalaryGrades();
             $jobtit_empstat = new JobTitEmpStat();
             $form_creator->popArr['paygrade'] = $paygrade->getSalGrades(true);
             $form_creator->popArr['jobSpecList'] = JobSpec::getAll();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $jobtitle->filterJobTitles($getArr['id']);
                 $form_creator->popArr['assEmploymentStat'] = $jobtit_empstat->getAssEmpStat($getArr['id']);
                 $form_creator->popArr['unAssEmploymentStat'] = $jobtit_empstat->getUnAssEmpStat($getArr['id']);
             }
             break;
         case 'SPC':
             $form_creator->formPath = '/templates/eimadmin/jobSpec.php';
             // Here we fetch all job specs for easier validation of duplicate names
             // Assuming it's unlikely that very large number of job specs will be defined.
             $form_creator->popArr['jobSpecList'] = JobSpec::getAll();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['jobSpec'] = JobSpec::getJobSpec($getArr['id']);
             } else {
                 $form_creator->popArr['jobSpec'] = new JobSpec();
             }
             break;
         case 'EST':
             $form_creator->formPath = '/templates/eimadmin/empstat.php';
             $empstat = new EmploymentStatus();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $empstat->filterEmpStat($getArr['id']);
             }
             break;
         case 'GEN':
             $form_creator->formPath = '/templates/eimadmin/geninfo.php';
             $geninfo = new GenInfo();
             $country = new CountryInfo();
             $province = new ProvinceInfo();
             $district = new DistrictInfo();
             $tabArr = $geninfo->filterGenInfo();
             $genInfoKeys = explode('|', $tabArr[0][0]);
             $genInfoValues = explode('|', $tabArr[0][1]);
             for ($c = 0; $genInfoKeys && count($genInfoKeys) > $c; $c++) {
                 $editArr[$genInfoKeys[$c]] = $genInfoValues[$c];
             }
             $form_creator->popArr['editArr'] = $editArr;
             $form_creator->popArr['cntlist'] = $country->getCountryCodes();
             if (isset($editArr['COUNTRY'])) {
                 $form_creator->popArr['provlist'] = $province->getProvinceCodes($editArr['COUNTRY']);
             }
             if (isset($editArr['STATE'])) {
                 $form_creator->popArr['districtlist'] = $district->getDistrictCodes($editArr['STATE']);
             }
             //Finding the numer of  employees
             $empInfo = new EmpInfo();
             $form_creator->popArr['empcount'] = $empInfo->countEmployee();
             break;
         case 'CUS':
             $form_creator->formPath = '/templates/eimadmin/customer.php';
             $customer = new Customer();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $customer->fetchCustomer($getArr['id']);
             } else {
                 $form_creator->popArr['editArr'] = new Customer();
             }
             break;
         case 'CTM':
             $form_creator->formPath = '/templates/eimadmin/customFields.php';
             $form_creator->popArr['available'] = CustomFields::getAvailableFieldNumbers();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = CustomFields::getCustomField($getArr['id']);
             } else {
                 $form_creator->popArr['editArr'] = new CustomFields();
             }
             break;
         case 'CEX':
             $form_creator->formPath = '/templates/eimadmin/customExportDefine.php';
             $form_creator->popArr['customExportList'] = CustomExport::getCustomExportList();
             if ($getArr['capturemode'] == 'updatemode') {
                 $customExport = CustomExport::getCustomExport($getArr['id']);
                 $form_creator->popArr['headings'] = $customExport->getHeadings();
                 $form_creator->popArr['available'] = $customExport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $customExport->getAssignedFields();
                 $form_creator->popArr['exportName'] = $customExport->getName();
                 $form_creator->popArr['id'] = $customExport->getId();
             } else {
                 $form_creator->popArr['headings'] = array();
                 $form_creator->popArr['available'] = CustomExport::getAllFields();
                 $form_creator->popArr['assigned'] = array();
                 $form_creator->popArr['exportName'] = null;
                 $form_creator->popArr['id'] = null;
             }
             break;
         case 'CIM':
             $form_creator->formPath = '/templates/eimadmin/customImportDefine.php';
             $form_creator->popArr['customImportList'] = CustomImport::getCustomImportList();
             if ($getArr['capturemode'] == 'updatemode') {
                 $customImport = CustomImport::getCustomImport($getArr['id']);
                 $form_creator->popArr['has_heading'] = $customImport->getContainsHeader();
                 $form_creator->popArr['available'] = $customImport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $customImport->getAssignedFields();
                 $form_creator->popArr['importName'] = $customImport->getName();
                 $form_creator->popArr['id'] = $customImport->getId();
                 $form_creator->popArr['compulsary_fields'] = CustomImport::getCompulsaryFields();
             } else {
                 $customImport = new CustomImport();
                 // Assign compulsary fields
                 $compulsary = CustomImport::getCompulsaryFields();
                 $customImport->setAssignedFields($compulsary);
                 $form_creator->popArr['has_heading'] = true;
                 $form_creator->popArr['available'] = $customImport->getAvailableFields();
                 $form_creator->popArr['assigned'] = $compulsary;
                 $form_creator->popArr['importName'] = null;
                 $form_creator->popArr['id'] = null;
                 $form_creator->popArr['compulsary_fields'] = $compulsary;
             }
             break;
         case 'CHD':
             $form_creator->formPath = '/templates/eimadmin/customExportHeadingDefine.php';
             $customExport = CustomExport::getCustomExport($getArr['id']);
             $headings = $customExport->getHeadings();
             $form_creator->popArr['headings'] = empty($headings) ? $customExport->getAssignedFields() : $headings;
             $form_creator->popArr['assigned'] = $customExport->getAssignedFields();
             $form_creator->popArr['exportName'] = $customExport->getName();
             $form_creator->popArr['id'] = $customExport->getId();
             break;
         case 'PAD':
             // Project Admin. Fall through to PRJ case below.
             $form_creator->getArr['uniqcode'] = "PRJ";
         case 'PRJ':
             $form_creator->formPath = '/templates/eimadmin/project.php';
             $project = new Projects();
             $customer = new Customer();
             $form_creator->popArr['cusid'] = $customer->fetchCustomers();
             $form_creator->popArr['employeeList'] = EmpInfo::getEmployeeMainDetails();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $project->fetchProject($getArr['id']);
                 $gw = new ProjectAdminGateway();
                 $form_creator->popArr['admins'] = $gw->getAdmins($getArr['id']);
             }
             break;
         case 'PAC':
             $form_creator->formPath = '/templates/eimadmin/projectActivity.php';
             /* If a HR admin, show all projects. Otherwise only show projects for which
              * user is an admin
              */
             $authorizeObj = new authorize($_SESSION['empID'], $_SESSION['isAdmin']);
             if ($authorizeObj->isAdmin()) {
                 $projects = new Projects();
                 /* Filter only not deleted projects */
                 $projects->setDeleted(Projects::PROJECT_NOT_DELETED);
                 $projectList = $projects->fetchProjects();
             } else {
                 if ($authorizeObj->isProjectAdmin()) {
                     $gw = new ProjectAdminGateway();
                     $projectList = $gw->getProjectsForAdmin($_SESSION['empID']);
                 }
             }
             /* If projectId given, get activities for that project else load first
              * project in list
              */
             $projectId = null;
             $activities = array();
             if (!empty($projectList)) {
                 if (isset($getArr['projectId']) && ($authorizeObj->isAdmin() || $authorizeObj->isProjectAdminOf($getArr['projectId']))) {
                     $projectId = $getArr['projectId'];
                 } else {
                     $projectId = $projectList[0]->getProjectId();
                 }
                 $activities = ProjectActivity::getActivityList($projectId);
             }
             $form_creator->popArr['projects'] = $projectList;
             $form_creator->popArr['projectId'] = $projectId;
             $form_creator->popArr['activities'] = $activities;
             break;
         case 'USR':
             $form_creator->formPath = '/templates/maintenance/users.php';
             $user = new Users();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $user->filterUsers($getArr['id']);
                 $form_creator->popArr['emplist'] = $user->getEmployeeCodes();
                 $form_creator->popArr['uglist'] = $user->getUserGroupCodes();
                 //$form_creator ->popArr['editArr'] = $user->filterChangeUsers($getArr['id']);
             }
             $form_creator->popArr['employeeSearchList'] = EmpInfo::getEmployeeSearchList();
             break;
         case 'USG':
             $form_creator->formPath = '/templates/maintenance/usergroups.php';
             $usrgrp = new UserGroups();
             if ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editArr'] = $usrgrp->filterUserGroups($getArr['id']);
             }
             break;
         case 'UGR':
             $form_creator->formPath = '/templates/maintenance/AdminMenu.php';
             $urights = new Rights();
             $usergroup = new UserGroups();
             $form_creator->popArr['ugDet'] = $usergroup->filterUserGroups($getArr['id']);
             $form_creator->popArr['modlist'] = $urights->getAllModules();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $urights->filterRights($arr);
             } else {
                 $form_creator->popArr['modlistUnAss'] = $urights->getModuleCodes($getArr['id']);
             }
             $form_creator->popArr['modlistAss'] = $urights->getAssRights($getArr['id']);
             break;
         case 'LDAP':
             if ($_SESSION['ldap'] == "enabled") {
                 $form_creator->formPath = '/templates/eimadmin/ldapConfiguration.php';
                 $ldapConfigObj = new LdapDetails();
                 $form_creator->popArr['editArr'] = $ldapConfigObj->retrieveLdapDetails();
             }
             break;
     }
     $form_creator->display();
 }
Ejemplo n.º 7
0
 function reDirect($getArr, $postArr, $object = null)
 {
     $form_creator = new FormCreator($getArr, $postArr);
     switch ($getArr['reqcode']) {
         case 'JSP':
             $form_creator->formPath = '/templates/hrfunct/hrempjobspec.php';
             $ejobsp = new EmpJobSpec();
             $empinfo = new EmpInfo();
             $jdcat = new JDCategory();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['catlist'] = $jdcat->getJDCatCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $ejobsp->filterEmpJobSpec($arr);
             } else {
                 $form_creator->popArr['unasscatlist'] = $jdcat->getUnAssJDCatCodes($getArr['id']);
             }
             $form_creator->popArr['rset'] = $ejobsp->getAssEmpJobSpec($getArr['id']);
             //$form_creator ->popArr['catlist']=$ejobsp->getJDCatCodes();
             break;
         case 'CXT':
             $form_creator->formPath = '/templates/hrfunct/hrempconext.php';
             $empconext = new EmpConExt();
             $empinfo = new EmpInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['empstat'] = $empinfo->filterEmpJobStat($getArr['id']);
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empconext->filterConExt($arr);
                 $form_creator->popArr['lastrec'] = $empconext->getLastRecord($getArr['id']);
             } else {
                 $form_creator->popArr['lastrec'] = $empconext->getLastRecord($getArr['id']);
             }
             $form_creator->popArr['rset'] = $empconext->getAssConExt($getArr['id']);
             break;
         case 'SAL':
             $form_creator->formPath = '/templates/hrfunct/hrempbassal.php';
             $empinfo = new EmpInfo();
             $empbassal = new EmpBasSalary();
             $currTyp = new CurrencyTypes();
             $form_creator->popArr['einfo'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['empdet'] = $empdet = $empinfo->filterEmpJobInfo($getArr['id']);
             $salGrd = $empdet[0][5];
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $edit = $empbassal->filterEmpBasSal($arr);
                 $form_creator->popArr['currlist'] = $empbassal->getCurrCodes($edit[0][1]);
             } else {
                 $form_creator->popArr['curlist'] = $empbassal->getUnAssCurrCodes($salGrd, $getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['cmbCurrCode'] = $object->cmbCurrCode;
                 }
             }
             $form_creator->popArr['rset'] = $empbassal->getAssEmpBasSal($getArr['id']);
             $form_creator->popArr['currAlllist'] = $currTyp->getAllCurrencyCodes();
             break;
         case 'LAN':
             $form_creator->formPath = '/templates/hrfunct/hremplan.php';
             $empinf = new EmpInfo();
             $emplan = new EmpLanguage();
             $laninfo = new LanguageInfo();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['lanlist'] = $lanlist = $laninfo->getLang();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $emplan->filterEmpLang($arr);
                 for ($c = 0; count($lanlist) > $c; $c++) {
                     if ($getArr['editID1'] == $lanlist[$c][0]) {
                         $ratSel = $lanlist[$c][2];
                     }
                 }
             } else {
                 if ($object != null) {
                     $form_creator->popArr['cmbLanCode'] = $object->cmbLanCode;
                     for ($c = 0; $lanlist && count($lanlist) > $c; $c++) {
                         if ($lanlist[$c][0] == $object->cmbLanCode) {
                             $ratSel = $lanlist[$c][2];
                         }
                     }
                     $form_creator->popArr['ratSel'] = $ratSel;
                 }
                 $form_creator->popArr['lanlist'] = $laninfo->getLang();
             }
             $form_creator->popArr['rsets'] = $emplan->getAssEmpLang($getArr['id']);
             break;
         case 'MEM':
             $form_creator->formPath = '/templates/hrfunct/hrempmemship.php';
             $empinf = new EmpInfo();
             $empmem = new EmpMembership();
             $memtype = new MembershipType();
             $memshipinfo = new MembershipInfo();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $edit = $empmem->filterEmpMembership($arr);
                 $form_creator->popArr['mship'] = $memshipinfo->getMembershipCodes($edit[0][2]);
             } else {
                 if ($object != null) {
                     $form_creator->popArr['cmbMemTypeCode'] = $object->cmbMemTypeCode;
                     $form_creator->popArr['mship'] = $memshipinfo->getUnAssMembershipCodes($getArr['id'], $object->cmbMemTypeCode);
                 }
                 $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
             }
             $form_creator->popArr['rset'] = $empmem->getAssEmpMembership($getArr['id']);
             $form_creator->popArr['mshipAll'] = $memshipinfo->getAllMembershipCodes();
             break;
         case 'EXC':
             $form_creator->formPath = '/templates/hrfunct/hrempextcur.php';
             $empinfo = new EmpInfo();
             $empextcur = new EmpExCur();
             $extracurr = new ExtraCurrActCat();
             $extrainfo = new ExtraCurActInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['catlist'] = $extracurr->getExCurCatCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $edit = $empextcur->filterEmpExCur($arr);
                 $form_creator->popArr['typelist'] = $extrainfo->getExCurTypeCodes($edit[0][2]);
             } else {
                 $form_creator->popArr['lastrec'] = $empextcur->getLastRecord($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['cmbExtCurCat'] = $catcode = $object->cmbExtCurCat;
                     $form_creator->popArr['typeunasslist'] = $extrainfo->getUnAssExCurTypeCodes($getArr['id'], $catcode);
                 }
             }
             $form_creator->popArr['rset'] = $empextcur->getAssExCur($getArr['id']);
             $form_creator->popArr['allcatlist'] = $extracurr->getExCurCatCodes();
             $form_creator->popArr['alltypelist'] = $extrainfo->getAllExtraCurActInfo();
             break;
         case 'EXP':
             $form_creator->formPath = '/templates/hrfunct/hrempwrkexp.php';
             $empinfo = new EmpInfo();
             $empworkex = new EmpWorkExp();
             $countryinfo = new CountryInfo();
             $proinfo = new ProvinceInfo();
             $form_creator->popArr['empDet'] = $empinfo->filterEmpMain($getArr['id']);
             if ($object != null) {
                 $form_creator->popArr['txtEmpExpCompany'] = $object->txtEmpExpCompany;
                 $form_creator->popArr['txtEmpExpToDat'] = $object->txtEmpExpToDat;
                 $form_creator->popArr['txtEmpExpDesOnLev'] = $object->txtEmpExpDesOnLev;
                 $form_creator->popArr['txtEmpExpYears'] = $object->txtEmpExpYears;
                 $form_creator->popArr['chkEmpExpWorkRelFlag'] = $object->chkEmpExpWorkRelFlag;
                 $form_creator->popArr['txtEmpExpMonths'] = $object->txtEmpExpMonths;
                 $form_creator->popArr['txtEmpExpAdd1'] = $object->txtEmpExpAdd1;
                 $form_creator->popArr['txtEmpExpAcc'] = $object->txtEmpExpAcc;
                 $form_creator->popArr['txtEmpExpAdd2'] = $object->txtEmpExpAdd2;
             }
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $edit = $empworkex->filterEmpWorkExp($arr);
                 $form_creator->popArr['list'] = $countryinfo->getCountryCodes();
                 if ($object != null) {
                     $form_creator->popArr['txtEmpExpAdd2'] = $pli = $object->txtEmpExpAdd2;
                     $form_creator->popArr['txtEmpExpConPers'] = $object->txtEmpExpConPers;
                     $form_creator->popArr['txtEmpExpAdd3'] = $object->txtEmpExpAdd3;
                     $form_creator->popArr['txtEmpExpTelep'] = $object->txtEmpExpTelep;
                     $form_creator->popArr['txtEmpResLev'] = $object->txtEmpResLev;
                     $form_creator->popArr['txtEmpExpAchmnt'] = $object->txtEmpExpAchmnt;
                     $form_creator->popArr['txtEmpExpFromDat'] = $object->txtEmpExpFromDat;
                     $form_creator->popArr['txtEmpExpEmail'] = $object->txtEmpExpEmail;
                     $form_creator->popArr['plist'] = $empinfo->getProvinceCodes($pli);
                 } else {
                     $form_creator->popArr['plist1'] = $proinfo->getProvinceCodes($edit[0][4]);
                 }
             } else {
                 $form_creator->popArr['newID'] = $empworkex->getLastRecord($getArr['id']);
                 $form_creator->popArr['list'] = $countryinfo->getCountryCodes();
                 if ($object != null) {
                     $form_creator->popArr['txtEmpExpCompany'] = $object->txtEmpExpCompany;
                     $form_creator->popArr['txtEmpExpToDat'] = $object->txtEmpExpToDat;
                     $form_creator->popArr['txtEmpExpDesOnLev'] = $object->txtEmpExpDesOnLev;
                     $form_creator->popArr['txtEmpExpYears'] = $object->txtEmpExpYears;
                     $form_creator->popArr['chkEmpExpWorkRelFlag'] = $object->chkEmpExpWorkRelFlag;
                     $form_creator->popArr['txtEmpExpMonths'] = $object->txtEmpExpMonths;
                     $form_creator->popArr['txtEmpExpAdd1'] = $object->txtEmpExpAdd1;
                     $form_creator->popArr['txtEmpExpAcc'] = $object->txtEmpExpAcc;
                     $form_creator->popArr['txtEmpExpTelep'] = $object->txtEmpExpTelep;
                     $form_creator->popArr['txtEmpResLev'] = $object->txtEmpResLev;
                     $form_creator->popArr['txtEmpExpAchmnt'] = $object->txtEmpExpAchmnt;
                     $form_creator->popArr['txtEmpExpFromDat'] = $object->txtEmpExpFromDat;
                     $form_creator->popArr['txtEmpExpEmail'] = $object->txtEmpExpEmail;
                     $form_creator->popArr['txtEmpExpAdd2'] = $plis = $object->txtEmpExpAdd2;
                     $form_creator->popArr['txtEmpExpAdd3'] = $object->txtEmpExpAdd3;
                     $form_creator->popArr['txtEmpExpConPers'] = $object->txtEmpExpConPers;
                     $form_creator->popArr['plist2'] = $empinfo->getProvinceCodes($plis);
                 }
             }
             $form_creator->popArr['rset'] = $empworkex->getAssEmpWorkExp($getArr['id']);
             break;
         case 'QUA':
             $form_creator->formPath = '/templates/hrfunct/hrempqual.php';
             $empinfo = new EmpInfo();
             $empqual = new EmpQualification();
             $qualtyp = new QualificationType();
             $qual = new Qualifications();
             $form_creator->popArr['statlist'] = array('First Class', 'Second Class Upr.', 'Second Class Lwr.');
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['typlist'] = $qualtyp->getQualificationTypeCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['editID'];
                 $arr[1] = $getArr['id'];
                 $form_creator->popArr['editArr'] = $empqual->filterEmpQual($arr);
                 $form_creator->popArr['quallist'] = $qual->getAllQualifications();
             } else {
                 if ($object != null) {
                     $form_creator->popArr['TypeCode'] = $object->TypeCode;
                     $form_creator->popArr['mship'] = $qual->getUnAssQualifications($getArr['id'], $object->TypeCode);
                 }
             }
             $form_creator->popArr['rset'] = $empqual->getAssEmpQual($getArr['id']);
             $form_creator->popArr['allquallist'] = $qual->getAllQualifications();
             break;
         case 'QAS':
             $form_creator->formPath = '/templates/hrfunct/hrempqualsub.php';
             $empinfo = new EmpInfo();
             $qual = new Qualifications();
             $empqualsub = new EmpQualSubject();
             $subinfo = new SubjectInfo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['qualDet'] = $qual->filterQualifications($getArr['QUA']);
             $form_creator->popArr['sublistAll'] = $subinfo->getSubjectCodes($getArr['QUA']);
             $form_creator->popArr['ratlist'] = $empqualsub->getRatGrds($getArr['QUA']);
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['QUA'];
                 $arr[2] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empqualsub->filterEmpQualSub($arr);
             } else {
                 $form_creator->popArr['sublistUnAss'] = $subinfo->getUnAssSubjects($getArr['id'], $getArr['QUA']);
             }
             $arr[0] = $getArr['id'];
             $arr[1] = $getArr['QUA'];
             $form_creator->popArr['sublistAss'] = $empqualsub->getAssEmpQualSub($arr);
             break;
         case 'CBN':
             $form_creator->formPath = '/templates/hrfunct/hrempcashben.php';
             $empinfo = new EmpInfo();
             $empcashben = new EmpCashBen();
             $cashben = new CashBen();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['bfilter'] = array('Salary Point' => 1, 'Designation' => 2, 'Employee' => 3);
             $form_creator->popArr['benlist'] = $cashben->getBenCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empcashben->filterEmpCashBen($arr);
             }
             $form_creator->popArr['cashbenAss'] = $empcashben->getAssEmpCashBen($getArr['id']);
             $form_creator->popArr['cashbenUnAss'] = $empcashben->getUnAssEmpCashBen($getArr['id']);
             if (isset($getArr['OBEN'])) {
                 $form_creator->popArr['cashbenOther'] = $cashben->getOthEmpCashBen($getArr['id']);
             }
             break;
         case 'NBN':
             $form_creator->formPath = '/templates/hrfunct/hrempnoncashben.php';
             $empinfo = new EmpInfo();
             $empnoncashben = new EmpNonCashBen();
             $noncashben = new NonCashBen();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['bfilter'] = array('Salary Point' => 1, 'Designation' => 2, 'Employee' => 3);
             $form_creator->popArr['benlist'] = $noncashben->getBenCodes();
             if (isset($getArr['editID'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID'];
                 $form_creator->popArr['editArr'] = $empnoncashben->filterEmpNonCashBen($arr);
             }
             $form_creator->popArr['cashbenAss'] = $empnoncashben->getAssEmpNonCashBen($getArr['id']);
             $form_creator->popArr['cashbenUnAss'] = $empnoncashben->getUnAssEmpNonCashBen($getArr['id']);
             if (isset($getArr['OBEN'])) {
                 $form_creator->popArr['cashbenOther'] = $noncashben->getOthEmpNonCashBen($getArr['id']);
             }
             break;
         case 'ESS':
         case 'EMP':
             $form_creator->formPath = '/templates/hrfunct/hrEmpMain.php';
             //hremp.php';
             $form_creator->popArr['arrMStat'] = array('Unmarried', 'Married', 'Divorced', 'Others');
             $empinfo = new EmpInfo();
             $pport = new EmpPassPort();
             $ddebit = new EmpDirectDebit();
             $dep = new EmpDependents();
             $econ = new EmpEmergencyCon();
             $chi = new EmpChildren();
             $attachment = new EmpAttach();
             $countryinfo = new CountryInfo();
             $porinfo = new ProvinceInfo();
             $nationinfo = new NationalityInfo();
             $location = new models_eimadmin_Location();
             $distric = new DistrictInfo();
             $jobtit = new JobTitle();
             $depen = new EmpDependents();
             $ethnicrace = new EthnicRace();
             $eeojobcat = new EEOJobCat();
             $emplan = new EmpLanguage();
             $laninfo = new LanguageInfo();
             $emplicen = new EmpLicenses();
             $licen = new Licenses();
             $empmem = new EmpMembership();
             $memtype = new MembershipType();
             $memshipinfo = new MembershipInfo();
             $emprepto = new EmpRepTo();
             $empskill = new EmpSkill();
             $skill = new Skills();
             $empworkex = new EmpWorkExp();
             $empeducation = new EmpEducation();
             $education = new Education();
             $empTax = new EmpTax();
             $form_creator->popArr['nation'] = $nationinfo->getNationCodes();
             $form_creator->popArr['loc'] = $location->getLocCodes();
             $form_creator->popArr['cntlist'] = $countryinfo->getCountryCodes();
             $form_creator->popArr['ethRace'] = $ethnicrace->getEthnicRaceCodes();
             $form_creator->popArr['eeojobcat'] = $eeojobcat->getEEOJobCatCodes();
             $form_creator->popArr['jobtit'] = $jobtit->getJobTit();
             $form_creator->popArr['hier'] = isset($res) ? $res : false;
             $form_creator->popArr['cntlist'] = $countrylist = $countryinfo->getCountryCodes();
             $form_creator->popArr['ppcntlist'] = $countrylist;
             $form_creator->popArr['customFieldList'] = CustomFields::getCustomFieldList();
             if ($getArr['capturemode'] == 'addmode') {
                 $form_creator->popArr['newID'] = $empinfo->getLastId();
                 if ($object != null) {
                     $form_creator->popArr['ctlist'] = $corptit->getCorpTitlesEmpInfo($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $des->getDesEmpInfo($object->cmbCorpTit);
                     $form_creator->popArr['plist'] = $porinfo->getProvinceCodes($object->cmbTaxCountry);
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($object->cmbPermProvince);
                     if (isset($postArr['cmbJobTitle'])) {
                         $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($postArr['cmbJobTitle'], 'JOB', 'allEmpStat');
                     }
                     $form_creator->popArr['ethRace'] = $ethnicrace->getEthnicRaceCodes($object->cmbEthnicRace);
                 }
             } elseif ($getArr['capturemode'] == 'updatemode') {
                 $form_creator->popArr['editTaxInfo'] = $empTax->getEmployeeTaxInfo($getArr['id']);
                 $form_creator->popArr['usStateList'] = $porinfo->getProvinceCodes('US');
                 $form_creator->popArr['empDDAss'] = $ddebit->getEmployeeDirectDebit($getArr['id']);
                 if (isset($getArr['DDSEQ'])) {
                     $form_creator->popArr['editDDForm'] = $ddebit->getDirectDebit($getArr['id'], $getArr['DDSEQ']);
                 }
                 $form_creator->popArr['editMainArr'] = $empinfo->filterEmpMain($getArr['id']);
                 $form_creator->popArr['editPersArr'] = $empinfo->filterEmpPers($getArr['id']);
                 $form_creator->popArr['editJobInfoArr'] = $empJobInfo = $empinfo->filterEmpJobInfo($getArr['id']);
                 $form_creator->popArr['editCustomInfoArr'] = $empCustomInfo = $empinfo->filterEmpCustomInfo($getArr['id']);
                 $view_controller = new ViewController();
                 $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($empJobInfo[0][2], 'JOB', 'allEmpStat');
                 $empJobTitle = $empJobInfo[0][2];
                 if (isset($postArr['cmbJobTitle'])) {
                     $form_creator->popArr['empstatlist'] = $view_controller->xajaxObjCall($postArr['cmbJobTitle'], 'JOB', 'allEmpStat');
                     $empJobTitle = $postArr['cmbJobTitle'];
                 }
                 if (CommonFunctions::isValidId($empJobTitle, 'JOB')) {
                     $empJobSpec = $view_controller->getJobSpecForJob($empJobTitle);
                 } else {
                     $empJobSpec = null;
                 }
                 $form_creator->popArr['jobSpec'] = $empJobSpec;
                 $jobTitleHistory = new JobTitleHistory();
                 $form_creator->popArr['jobTitleHistory'] = $jobTitleHistory->getHistory($getArr['id']);
                 $empDivisionHistory = new SubDivisionHistory();
                 $form_creator->popArr['subDivisionHistory'] = $empDivisionHistory->getHistory($getArr['id']);
                 $locationHistory = new LocationHistory();
                 $form_creator->popArr['locationHistory'] = $locationHistory->getHistory($getArr['id']);
                 $form_creator->popArr['assignedlocationList'] = EmpLocation::getEmpLocations($getArr['id']);
                 $form_creator->popArr['availablelocationList'] = EmpLocation::getUnassignedLocations($getArr['id']);
                 $form_creator->popArr['editPermResArr'] = $edit = $editPermRes = $empinfo->filterEmpContact($getArr['id']);
                 $form_creator->popArr['provlist'] = $porinfo->getProvinceCodes($edit[0][4]);
                 $form_creator->popArr['citylist'] = $distric->getDistrictCodes($edit[0][5]);
                 $form_creator->popArr['empPPAss'] = $pport->getAssEmpPP($getArr['id']);
                 $form_creator->popArr['empDepAss'] = $dep->getAssEmpDep($getArr['id']);
                 $form_creator->popArr['empECAss'] = $econ->getAssEmpEC($getArr['id']);
                 $form_creator->popArr['empChiAss'] = $chi->getAssEmpChi($getArr['id']);
                 $form_creator->popArr['empAttAss'] = $attachment->getAssEmpAtt($getArr['id']);
                 $form_creator->popArr['empDpAss'] = $depen->getAssEmpDep($getArr['id']);
                 $form_creator->popArr['newPPID'] = $pport->getLastRecord($getArr['id']);
                 if (isset($getArr['PPSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['PPSEQ'];
                     $form_creator->popArr['editPPForm'] = $pport->filterEmpPP($arr);
                 }
                 $form_creator->popArr['newECID'] = $econ->getLastRecord($getArr['id']);
                 if (isset($getArr['ECSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['ECSEQ'];
                     $form_creator->popArr['editECForm'] = $econ->filterEmpEC($arr);
                 }
                 $form_creator->popArr['newDepID'] = $dep->getLastRecord($getArr['id']);
                 if (isset($getArr['depSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['depSEQ'];
                     $form_creator->popArr['editDepForm'] = $dep->filterEmpDep($arr);
                 }
                 $form_creator->popArr['newCID'] = $chi->getLastRecord($getArr['id']);
                 if (isset($getArr['CHSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['CHSEQ'];
                     $form_creator->popArr['editChiForm'] = $chi->filterEmpChi($arr);
                 }
                 if (isset($getArr['ATTACH'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['ATTACH'];
                     $form_creator->popArr['editAttForm'] = $attachment->filterEmpAtt($arr);
                 }
                 $form_creator->popArr['lantype'] = array('Writing' => 1, 'Speaking' => 2, 'Reading' => 3);
                 $form_creator->popArr['grdcodes'] = array('Poor' => 1, 'Basic' => 2, 'Good' => 3, 'Mother Tongue' => 4);
                 $form_creator->popArr['lanlist'] = $lanlist = $laninfo->getLang();
                 if (isset($getArr['lanSEQ'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['lanSEQ'];
                     $arr[2] = $getArr['lanFLU'];
                     $form_creator->popArr['editLanArr'] = $emplan->filterEmpLang($arr);
                 }
                 $form_creator->popArr['rsetLang'] = $emplan->getAssEmpLang($getArr['id']);
                 $form_creator->popArr['allLicenlist'] = $licenlist = $licen->getLicensesCodes();
                 $form_creator->popArr['unassLicenlist'] = $licen->getUnAssLicensesCodes($getArr['id']);
                 if (isset($getArr['LIC'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['LIC'];
                     $form_creator->popArr['editLicenseArr'] = $emplicen->filterEmpLicenses($arr);
                 }
                 $form_creator->popArr['rsetLicense'] = $emplicen->getAssEmpLicenses($getArr['id']);
                 $form_creator->popArr['typlist'] = $typlist = $memtype->getMembershipTypeCodes();
                 if (isset($getArr['MEM'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['MEM'];
                     $arr[2] = $getArr['MTP'];
                     $form_creator->popArr['editMembershipArr'] = $edit = $empmem->filterEmpMembership($arr);
                     $form_creator->popArr['mship'] = $memshipinfo->getMembershipCodes($edit[0][2]);
                 }
                 $form_creator->popArr['rsetMembership'] = $empmem->getAssEmpMembership($getArr['id']);
                 $form_creator->popArr['mshipAll'] = $memshipinfo->getAllMembershipCodes();
                 $empbassal = new EmpBasSalary();
                 $currTyp = new CurrencyTypes();
                 $jobtit = new JobTitle();
                 $salgradelist = new SalaryGrades();
                 $form_creator->popArr['salgradelist'] = $salgradelist->getSalGrades(true);
                 $empdet = $empinfo->filterEmpJobInfo($getArr['id']);
                 $jt = $jobtit->filterJobTitles($empdet[0][2]);
                 $form_creator->popArr['payPeriodList'] = PayPeriod::getPayPeriodList();
                 $form_creator->popArr['salGrd'] = $salGrd = $empbassal->getEmpSalGrade($getArr['id']);
                 if (isset($getArr['PAY'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['PAY'];
                     $arr[2] = $getArr['CUR'];
                     $form_creator->popArr['editPaymentArr'] = $edit = $empbassal->filterEmpBasSal($arr);
                     $form_creator->popArr['salGrd'] = $salGrd = $edit[0][1];
                     $form_creator->popArr['currlist'] = $empbassal->getCurrCodes($edit[0][1]);
                 }
                 $form_creator->popArr['unAssCurrList'] = $empbassal->getUnAssCurrCodes($salGrd, $getArr['id']);
                 $form_creator->popArr['rsetPayment'] = $empbassal->getAssEmpBasSal($getArr['id']);
                 $form_creator->popArr['currAlllist'] = $currTyp->getAllCurrencyCodes();
                 $form_creator->popArr['suprset'] = $emprepto->getEmpSup($getArr['id']);
                 $form_creator->popArr['empname'] = $empinfo->getEmpInfo();
                 $form_creator->popArr['subrset'] = $emprepto->getEmpSub($getArr['id']);
                 if (isset($getArr['editIDSup'])) {
                     $arr[0] = $getArr['editIDSup'];
                     $arr[1] = $getArr['id'];
                     $arr[2] = $getArr['RepMethod'];
                     $form_creator->popArr['editIDSupInfo'] = $emprepto->filterEmpRepTo($arr);
                 }
                 if (isset($getArr['editIDSub'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['editIDSub'];
                     $arr[2] = $getArr['RepMethod'];
                     $form_creator->popArr['editIDSubInfo'] = $emprepto->filterEmpRepTo($arr);
                 }
                 $form_creator->popArr['allSkilllist'] = $skill->getSkillCodes();
                 $form_creator->popArr['uskilllist'] = $skill->getUnAssSkillCodes($getArr['id']);
                 if (isset($getArr['SKILL'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['SKILL'];
                     $form_creator->popArr['editSkillArr'] = $empskill->filterEmpSkill($arr);
                 }
                 $form_creator->popArr['rsetSkill'] = $empskill->getAssEmpSkill($getArr['id']);
                 $form_creator->popArr['newWrkExpID'] = $empworkex->getLastRecord($getArr['id']);
                 if (isset($getArr['WRKEXP'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['WRKEXP'];
                     $form_creator->popArr['editWrkExpArr'] = $edit = $empworkex->filterEmpWorkExp($arr);
                 }
                 $form_creator->popArr['rsetWrkExp'] = $empworkex->getAssEmpWorkExp($getArr['id']);
                 $form_creator->popArr['allEduCodes'] = $education->getListofEducation(0, '', 0);
                 $form_creator->popArr['unAssEduCodes'] = $empeducation->getUnAssEduCodes($getArr['id']);
                 if (isset($getArr['EDU'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['EDU'];
                     $form_creator->popArr['editEducationArr'] = $empeducation->filterEmpEducation($arr);
                 }
                 $form_creator->popArr['rsetEducation'] = $empeducation->getAssEmpEducation($getArr['id']);
                 if ($object != null) {
                     $form_creator->popArr['ctlist'] = $corptit->getCorpTitlesEmpInfo($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $des->getDesEmpInfo($object->cmbCorpTit);
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($object->cmbPermProvince);
                     $form_creator->popArr['brchlist'] = $brch->getUnAssBranchCodes($getArr['id'], $object->cmbBank);
                     $form_creator->popArr['ctlist'] = $empinfo->getCorpTitles($object->cmbSalGrd);
                     $form_creator->popArr['deslist'] = $empinfo->getDes($object->cmbCorpTit);
                     $form_creator->popArr['resplist'] = $empinfo->getProvinceCodes($object->cmbPermCountry);
                     $form_creator->popArr['resdlist'] = $empinfo->getDistrictCodes($object->cmbPermProvince);
                     $form_creator->popArr['brchlist'] = $brch->getUnAssBranchCodes($getArr['id'], $object->cmbBank);
                 } else {
                     $form_creator->popArr['resplist'] = $porinfo->getProvinceCodes($editPermRes[0][10]);
                     $form_creator->popArr['resdlist'] = $distric->getDistrictCodes($editPermRes[0][11]);
                 }
                 $empconext = new EmpConExt();
                 $form_creator->popArr['newConExtID'] = $empconext->getLastRecord($getArr['id']);
                 if (isset($getArr['CONEXT'])) {
                     $arr[0] = $getArr['id'];
                     $arr[1] = $getArr['CONEXT'];
                     $form_creator->popArr['editConExtArr'] = $empconext->filterConExt($arr);
                 }
                 $form_creator->popArr['rsetConExt'] = $empconext->getAssConExt($getArr['id']);
             }
             break;
         case 'REP':
             $form_creator->formPath = '/templates/hrfunct/hremprepto.php';
             $empinfo = new EmpInfo();
             $emprepto = new EmpRepTo();
             $form_creator->popArr['empdet'] = $empinfo->filterEmpMain($getArr['id']);
             $form_creator->popArr['suprset'] = $emprepto->getEmpSup($getArr['id']);
             $form_creator->popArr['empname'] = $empinfo->getEmpInfo();
             $form_creator->popArr['subrset'] = $emprepto->getEmpSub($getArr['id']);
             if (isset($getArr['editIDSup'])) {
                 $arr[0] = $getArr['editIDSup'];
                 $arr[1] = $getArr['id'];
                 $arr[2] = $getArr['repmethod'];
                 $form_creator->popArr['editIDSupInfo'] = $emprepto->filterEmpRepTo($arr);
             }
             if (isset($getArr['editIDSub'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editIDSub'];
                 $arr[2] = $getArr['repmethod'];
                 $form_creator->popArr['editIDSubInfo'] = $emprepto->filterEmpRepTo($arr);
             }
             break;
         case 'SKI':
             $form_creator->formPath = '/templates/hrfunct/hrempskill.php';
             $empinf = new EmpInfo();
             $empskill = new EmpSkill();
             $skill = new Skills();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['allSkilllist'] = $skill->getSkillCodes();
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $empskill->filterEmpSkill($arr);
             } else {
                 $form_creator->popArr['uskilllist'] = $skill->getUnAssSkillCodes($getArr['id']);
             }
             $form_creator->popArr['rsets'] = $empskill->getAssEmpSkill($getArr['id']);
             break;
         case 'LIC':
             $form_creator->formPath = '/templates/hrfunct/hremplicenses.php';
             $empinf = new EmpInfo();
             $emplicen = new EmpLicenses();
             $licen = new Licenses();
             $form_creator->popArr['empDet'] = $empinf->filterEmpMain($getArr['id']);
             $form_creator->popArr['allLicenlist'] = $licenlist = $licen->getLicensesCodes();
             $form_creator->popArr['unassLicenlist'] = $licen->getUnAssLicensesCodes($getArr['id']);
             if (isset($getArr['editID1'])) {
                 $arr[0] = $getArr['id'];
                 $arr[1] = $getArr['editID1'];
                 $arr[2] = $getArr['editID2'];
                 $form_creator->popArr['editArr'] = $emplicen->filterEmpLicenses($arr);
             }
             $form_creator->popArr['rsets'] = $emplicen->getAssEmpLicenses($getArr['id']);
             break;
     }
     $form_creator->display();
 }
Ejemplo n.º 8
0
    /**
     * Create edit fields from xml property
     */
    protected function toEditFields(&$textbox1)
    {
        global $wgStylePath, $wgScriptPath, $wgOut, $wgUser, $wgRequest;
        if (!$this->title->exists()) {
            return '<p><font color=red>Image does not exist.  You must</font> <a href="/wiki/Special:Upload"><b>upload it.</b></a></p>';
        }
        // add javascript functions
        $wgOut->addScript("<script type='text/javascript' src=\"{$wgScriptPath}/autocomplete.10.js\"></script>");
        if ($wgRequest->getVal('action') != 'submit') {
            $wgOut->addScript("<script type='text/javascript' src=\"{$wgScriptPath}/fnclientwiki.yui.1.js\"></script>");
        }
        $wgOut->addScript("<script type='text/javascript' src=\"{$wgScriptPath}/image.1.js\"></script>");
        $wgOut->addScript("<script type='text/javascript' src=\"{$wgStylePath}/common/upload.2.js\"></script>");
        $date = '';
        $place = '';
        $copyright = '';
        $license = '';
        $notes = '';
        $invalidStyle = ' style="background-color:#fdd;"';
        $licenseStyle = '';
        $people = array();
        $families = array();
        if (!isset($this->xml)) {
            $this->addWhatLinksHere($people, $families);
        } else {
            $date = htmlspecialchars((string) $this->xml->date);
            $place = htmlspecialchars((string) $this->xml->place);
            $people = StructuredData::getTitlesAsArray($this->xml->person);
            $families = StructuredData::getTitlesAsArray($this->xml->family);
            $copyright = htmlspecialchars((string) $this->xml->copyright_holder);
            $license = (string) $this->xml->license;
            if (isset($this->xml->note)) {
                foreach ($this->xml->note as $note) {
                    $title = htmlspecialchars((string) $note['title']);
                    $content = htmlspecialchars((string) $note);
                    $notes .= '<note left="' . (string) $note['left'] . '" top="' . (string) $note['top'] . '" right="' . (string) $note['right'] . '" bottom="' . (string) $note['bottom'] . '" title="' . $title . "\">{$content}</note>\n";
                }
            }
        }
        // get license options
        $licenses = new Licenses();
        $licenseLabel = wfMsgHtml('license');
        $sk = $wgUser->getSkin();
        $licenseHelpUrl = $sk->makeInternalOrExternalUrl(wfMsgForContent('licensehelppage'));
        $licenseHelp = '<a target="helpwindow" href="' . $licenseHelpUrl . '">' . htmlspecialchars(wfMsg('licensehelp')) . '</a>';
        $nolicense = wfMsgHtml('nolicense');
        $licenseshtml = $licenses->getHTML();
        if ($license) {
            $licenseshtml = preg_replace('$value="' . StructuredData::protectRegexSearch($license) . '"$', 'value="' . StructuredData::protectRegexReplace($license) . '" selected="selected"', $licenseshtml);
        }
        $result = '';
        // add fotonotes
        $fn = new Fotonotes($this->title);
        $result .= $fn->renderEditableImage(isset($this->xml) ? $this->xml->note : null) . '<br>';
        // error messages
        if (!SDImage::isValidLicense($license)) {
            $licenseStyle = $invalidStyle;
            $result .= "<p><font color=red>You must select a license</font></p>";
        }
        // add fields
        $personTbl = $this->addPageInput($people, 'person');
        $familyTbl = $this->addPageInput($families, 'family');
        $notes = htmlspecialchars($notes);
        $result .= <<<END
<input type="hidden" id="notesField" name="notes" value="{$notes}"/>
<table border=0>
<tr><td>&nbsp;</td><td><b>License and copyright</b></td></tr>
<tr><td align='right'><label for='wpLicense'>{$licenseLabel} (&nbsp;{$licenseHelp}&nbsp;):</label></td>
\t<td align='left'><select name='license' id='wpLicense' tabindex='1' onchange='licenseSelectorCheck()'>
\t\t<option value=''>{$nolicense}</option>{$licenseshtml}</select></td></tr>
<tr><td align='right'><label for="copyright_holder">Name of copyright holder:</label></td><td align='left'><input tabindex="1" name="copyright_holder" value="{$copyright}" size="30"/></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td><b>Time place and people</td></tr>
<tr><td align='right'><label for="date">Image date:</label></td><td align='left'><input tabindex="1" name="date" value="{$date}" size="15"/></td></tr>
<tr><td align='right'><label for="place">Place:</label></td><td align='left'><input class="place_input" tabindex="1" name="place" value="{$place}" size="30"/></td></tr>
<tr><td align='right' valign='top'>Person page:</td><td align='left'>{$personTbl}</td></tr>
<tr><td>&nbsp;</td><td align='left'><a id='person_link' href='javascript:void(0)' onClick='addImagePage("person"); return preventDefaultAction(event);'>Add another person</a></td></tr>
<tr><td align='right' valign='top'>Family page:</td><td align='left'>{$familyTbl}</td></tr>
<tr><td>&nbsp;</td><td align='left'><a id='family_link' href='javascript:void(0)' onClick='addImagePage("family"); return preventDefaultAction(event);'>Add another family</a></td></tr>
</table><h2>Text</h2>
END;
        return $result;
    }
Ejemplo n.º 9
0
            if (trim($line) === '') {
                array_shift($lines);
                continue;
            }
            break;
        }
        return implode(PHP_EOL, $lines);
    }
    private function getAuthors($file)
    {
        // only add authors that changed code and not the license header
        $licenseHeaderEndsAtLine = trim(shell_exec("grep -n '*/' {$file} | head -n 1 | cut -d ':' -f 1"));
        $out = shell_exec("git blame --line-porcelain -L {$licenseHeaderEndsAtLine}, {$file} | sed -n 's/^author //p;s/^author-mail //p' | sed 'N;s/\\n/ /' | sort -f | uniq");
        $authors = explode(PHP_EOL, $out);
        $authors = array_filter($authors, function ($author) {
            return !in_array($author, ['', 'Not Committed Yet <not.committed.yet>', 'Jenkins for ownCloud <*****@*****.**>']);
        });
        $authors = array_map(function ($author) {
            $this->authors[$author] = $author;
            return " * @author {$author}";
        }, $authors);
        return implode(PHP_EOL, $authors);
    }
}
$licenses = new Licenses();
if (isset($argv[1])) {
    $licenses->exec($argv[1]);
} else {
    $licenses->exec(['../apps/dav', '../apps/encryption', '../apps/federation', '../apps/files', '../apps/files_external', '../apps/files_sharing', '../apps/files_trashbin', '../apps/files_versions', '../apps/provisioning_api', '../apps/user_ldap', '../core', '../lib', '../ocs', '../settings', '../console.php', '../cron.php', '../index.php', '../public.php', '../remote.php', '../status.php', '../version.php']);
    $licenses->writeAuthorsFile();
}
Ejemplo n.º 10
0
 /**
  * Save Job Title
  * @param sfWebRequest $request
  * @return unknown_type
  */
 public function executeSaveLicenses(sfWebRequest $request)
 {
     $educationService = new EducationService();
     if ($request->isMethod('post')) {
         $licenses = new Licenses();
         $licenses->setLicensesDesc($request->getParameter('txtLicensesDesc'));
         $educationService->saveLicenses($licenses);
         $this->setMessage('SUCCESS', array(TopLevelMessages::SAVE_SUCCESS));
         $this->redirect('admin/listLicenses');
     }
 }
Ejemplo n.º 11
0
 /**
  * Displays the main upload form, optionally with a highlighted
  * error message up at the top.
  *
  * @param string $msg as HTML
  * @access private
  */
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload;
     global $wgRequest, $wgAllowCopyUploads;
     if (!wfRunHooks('UploadForm:initial', array(&$this))) {
         wfDebug("Hook 'UploadForm:initial' broke output of the upload form");
         return false;
     }
     $cols = intval($wgUser->getOption('cols'));
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     $wgOut->addHTML('<div id="uploadtext">');
     $wgOut->addWikiText(wfMsg('uploadtext'));
     $wgOut->addHTML('</div>');
     $sourcefilename = wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsgWikiHtml('fileuploadsummary');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = SpecialPage::getTitleFor('Upload');
     $action = $titleObj->escapeLocalURL();
     $encDestFile = htmlspecialchars($this->mDestFile);
     $watchChecked = $wgUser->getOption('watchdefault') || $wgUser->getOption('watchcreations') && $this->mDestFile == '' ? 'checked="checked"' : '';
     // Prepare form for upload or upload/copy
     if ($wgAllowCopyUploads && $wgUser->isAllowed('upload_by_url')) {
         $filename_form = "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked />" . "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' onfocus='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\");toggle_element_check(\"wpSourceTypeFile\",\"wpSourceTypeURL\")'" . ($this->mDestFile ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />" . wfMsgHTML('upload_source_file') . "<br/>" . "<input type='radio' id='wpSourceTypeURL' name='wpSourceType' value='web' onchange='toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\")' />" . "<input tabindex='1' type='text' name='wpUploadFileURL' id='wpUploadFileURL' onfocus='toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\");toggle_element_check(\"wpSourceTypeURL\",\"wpSourceTypeFile\")'" . ($this->mDestFile ? "" : "onchange='fillDestFilename(\"wpUploadFileURL\")' ") . "size='40' DISABLED />" . wfMsgHtml('upload_source_url');
     } else {
         $filename_form = "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />" . "<input type='hidden' name='wpSourceType' value='file' />";
     }
     $wgOut->addHTML("\n\t<form id='upload' method='post' enctype='multipart/form-data' action=\"{$action}\">\n\t\t<table border='0'>\n\t\t<tr>\n\t  {$this->uploadFormTextTop}\n\t\t\t<td align='right' valign='top'><label for='wpUploadFile'>{$sourcefilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t{$filename_form}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadDescription'>{$summary}</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars($this->mUploadDescription) . "</textarea>\n\t   {$this->uploadFormTextAfterSummary}\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>");
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wpLicense'>{$license}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<script type='text/javascript' src=\"{$wgStylePath}/common/upload.js\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='4'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     if ($wgUseCopyrightUpload) {
         $filestatus = wfMsgHtml('filestatus');
         $copystatus = htmlspecialchars($this->mUploadCopyStatus);
         $filesource = wfMsgHtml('filesource');
         $uploadsource = htmlspecialchars($this->mUploadSource);
         $wgOut->addHTML("\n\t\t\t        <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>{$filestatus}:</label></td>\n\t\t\t        <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"{$copystatus}\" size='40' /></td>\n\t\t        </tr>\n\t\t\t<tr>\n\t\t        \t<td align='right'><label for='wpUploadCopyStatus'>{$filesource}:</label></td>\n\t\t\t        <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"{$uploadsource}\" size='40' /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     $wgOut->addHtml("\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthisupload') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>");
 }
Ejemplo n.º 12
0
            return " * @author {$author}";
        }, $authors);
        return implode(PHP_EOL, $authors);
    }
    private function checkCoreMailMap($author)
    {
        if (empty($this->mailMap)) {
            $content = file_get_contents(__DIR__ . '/../.mailmap');
            $entries = explode("\n", $content);
            foreach ($entries as $entry) {
                if (strpos($entry, '> ') === false) {
                    $this->mailMap[$entry] = $entry;
                } else {
                    list($use, $actual) = explode('> ', $entry);
                    $this->mailMap[$actual] = $use . '>';
                }
            }
        }
        if (isset($this->mailMap[$author])) {
            return $this->mailMap[$author];
        }
        return $author;
    }
}
$licenses = new Licenses();
if (isset($argv[1])) {
    $licenses->exec($argv[1], isset($argv[2]) ? $argv[1] : false);
} else {
    $licenses->exec(['../apps/comments', '../apps/dav', '../apps/encryption', '../apps/federatedfilesharing', '../apps/federation', '../apps/files', '../apps/files_external', '../apps/files_sharing', '../apps/files_trashbin', '../apps/files_versions', '../apps/provisioning_api', '../apps/systemtags', '../apps/testing', '../apps/updatenotification', '../apps/user_ldap', '../core', '../lib', '../ocs', '../ocs-provider', '../settings', '../console.php', '../cron.php', '../index.php', '../public.php', '../remote.php', '../status.php', '../version.php']);
    $licenses->writeAuthorsFile();
}
Ejemplo n.º 13
0
</label>
			<input id="ImageUploadExtension" type="hidden" value="<?php 
    echo $props['extension'];
    ?>
" />
			<input id="ImageUploadReplaceDefault" type="hidden" value="on" />
		</div>

		<div id="LicensingRow">
			<h3><?php 
    echo wfMsg('wmu-licensing');
    ?>
</h3>
			<span id="ImageUploadLicenseSpan" >
			<?php 
    $licenses = new Licenses(array('id' => 'ImageUploadLicense', 'name' => 'ImageUploadLicense', 'fieldname' => 'ImageUploadLicense'));
    echo $licenses->getInputHTML(null);
    ?>
			</span>
			<div id="ImageUploadLicenseControl">
				<a id="ImageUploadLicenseLink" href="#" onclick="WMU_toggleLicenseMesg(event);" >[<?php 
    echo wfMsg('wmu-hide-license-msg');
    ?>
]</a>
			</div>
			<div id="ImageUploadLicenseTextWrapper">
				<div id="ImageUploadLicenseText">&nbsp;</div>
			</div>
		</div>
	</div>
 public function __construct()
 {
     parent::__construct(array('fieldname' => 'JsonLicenses'));
 }
Ejemplo n.º 15
0
 /**
  * Displays the main upload form, optionally with a highlighted
  * error message up at the top.
  *
  * @param string $msg as HTML
  * @access private
  */
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload, $wgMaxUploadFiles;
     if ($msg == '' && !$this->mShowUploadForm) {
         return;
     }
     $cols = intval($wgUser->getOption('cols'));
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $wgOut->addHTML("<b>{$this->mUploadSaveName}</b>\n<br/>");
         $sub = wfMsgHtml('addresswarnings');
         $wgOut->addHTML("<b>{$sub}</b><br/><span class='error'>{$msg}</span>\n");
     }
     $wgOut->addHTML('<div id="uploadtext">');
     $wgOut->addWikiText(wfMsg('multiuploadtext'));
     $wgOut->addHTML('</div>');
     $sk = $wgUser->getSkin();
     $sourcefilename .= wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsg('fileuploadsummary');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = Title::makeTitle(NS_SPECIAL, 'MultipleUpload');
     $action = $titleObj->escapeLocalURL();
     $watchChecked = $wgUser->getOption('watchdefault') ? 'checked="checked"' : '';
     $wgOut->addHTML("\n<script type=\"text/javascript\">\nfunction fillDestFilenameMulti(i) {\n    if (!document.getElementById)\n        return;\n\tvar path = document.getElementById('wpUploadFile_' + i).value;\n    // Find trailing part \n    var slash = path.lastIndexOf('/');\n    var backslash = path.lastIndexOf('\\\\');\n    var fname;\n    if (slash == -1 && backslash == -1) {\n        fname = path;\n    } else if (slash > backslash) {\n        fname = path.substring(slash+1, 10000);\n    } else {\n        fname = path.substring(backslash+1, 10000);\n    }\n    \n    // Capitalise first letter and replace spaces by underscores\n    fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');\n    \n    // Output result\n    var destFile = document.getElementById('wpDestFile_' + i);\n    if (destFile)\n        destFile.value = fname;\n        destFile.value = fname.substr(0, fname.lastIndexOf('.') )\n                     + \"_\" + Math.round(1000*Math.random())\n                     + fname.substr(fname.lastIndexOf('.') );\n}  \n</script>\n            <script type='text/javascript'>\n                function checkFFBug() {\n                    if ((document.uploadform.wpLicense.value == '' || document.uploadform.wpLicense.value == 'No License' ) \n                        && navigator.userAgent.toLowerCase().indexOf('firefox') >= 0) { \n                        return confirm('" . wfMsg('no_license_selected') . "'); \n                    }\n                    return true;\n            }\n            </script>\n\t<form id='upload' name='uploadform' method='post' enctype='multipart/form-data' action=\"{$action}\" onsubmit='return checkFFBug();'>\n\t\t<table border='0'>\n\t\t<tr>\n\t\t\t<td align='left'><label for='wpUploadFile'><b>{$sourcefilename}:</b></label></td>\n\t\t\t<td align='left'><label for='wpDestFile'><b>{$destfilename}:</b></label></td>\n\t\t\t<td align='left' valign='middle'><b>{$summary}</b></td>\n\t\t</tr>");
     for ($i = 0; $i < $wgMaxUploadFiles; $i++) {
         $encDestFile = htmlspecialchars($this->mDestFileArray[$i]);
         $wgOut->addHTML("\n\t\t<tr>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='1' type='file' name='wpUploadFile_{$i}' id='wpUploadFile_{$i}' " . ($this->mDestFile ? "" : "onchange='fillDestFilenameMulti({$i})' ") . "size='25' />\n\t\t\t</td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='2' type='text' name='wpDestFile_{$i}' id='wpDestFile_{$i}' size='25' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='3' name='wpUploadDescription_{$i}' id='wpUploadDescription' value=\"" . htmlspecialchars($this->mUploadDescription) . "\" size=25>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>");
     }
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t<td align='left' colspan=3>\n\t\t\t<label for='wpLicense'>{$license}:</label>\n\t\t\t\t<script type='text/javascript' src=\"{$wgStylePath}/common/upload.js\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='4' style='font-size: xx-small;'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>");
     }
     if ($wgUseCopyrightUpload) {
         $filestatus = wfMsgHtml('filestatus');
         $copystatus = htmlspecialchars($this->mUploadCopyStatus);
         $filesource = wfMsgHtml('filesource');
         $uploadsource = htmlspecialchars($this->mUploadSource);
         $wgOut->addHTML("\n\t\t\t        <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>{$filestatus}:</label></td>\n\t\t\t        <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"{$copystatus}\" size='40' /></td>\n\t\t        </tr>\n\t\t\t<tr>\n\t\t        \t<td align='right'><label for='wpUploadCopyStatus'>{$filesource}:</label></td>\n\t\t\t        <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"{$uploadsource}\" size='40' /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     $wgOut->addHtml("\n\t\t<td>\n \t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n            <label for='wpWatchthis'>" . wfMsgHtml('watchthis') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\n\t</tr>\n\t<tr>\n\t\t<td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>");
 }
Ejemplo n.º 16
0
 /**
  * Displays the main upload form, optionally with a highlighted
  * error message up at the top.
  *
  * @param string $msg as HTML
  * @access private
  */
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload;
     $cols = intval($wgUser->getOption('cols'));
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     $wgOut->addHTML('<div id="uploadtext">');
     $wgOut->addWikiText(wfMsg('uploadtext'));
     $wgOut->addHTML('</div>');
     $sk = $wgUser->getSkin();
     $sourcefilename = wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsgWikiHtml('fileuploadsummary');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = Title::makeTitle(NS_SPECIAL, 'Upload');
     $action = $titleObj->escapeLocalURL();
     $encDestFile = htmlspecialchars($this->mDestFile);
     $watchChecked = $wgUser->getOption('watchdefault') ? 'checked="checked"' : '';
     $wgOut->addHTML("\n\t<form id='upload' method='post' enctype='multipart/form-data' action=\"{$action}\">\n\t\t<table border='0'>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile ? "" : "onchange='fillDestFilename()' ") . "size='40' />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadDescription'>{$summary}</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars($this->mUploadDescription) . "</textarea>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>");
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wpLicense'>{$license}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<script type='text/javascript' src=\"{$wgStylePath}/common/upload.js\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='4'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     if ($wgUseCopyrightUpload) {
         $filestatus = wfMsgHtml('filestatus');
         $copystatus = htmlspecialchars($this->mUploadCopyStatus);
         $filesource = wfMsgHtml('filesource');
         $uploadsource = htmlspecialchars($this->mUploadSource);
         $wgOut->addHTML("\n\t\t\t        <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>{$filestatus}:</label></td>\n\t\t\t        <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"{$copystatus}\" size='40' /></td>\n\t\t        </tr>\n\t\t\t<tr>\n\t\t        \t<td align='right'><label for='wpUploadCopyStatus'>{$filesource}:</label></td>\n\t\t\t        <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"{$uploadsource}\" size='40' /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     $wgOut->addHtml("\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthis') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>");
 }
Ejemplo n.º 17
0
 /**
  * Displays the main upload form, optionally with a highlighted
  * error message up at the top.
  *
  * @param string $msg as HTML
  * @access private
  */
 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload;
     $cols = intval($wgUser->getOption('cols'));
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     $wgOut->addHTML('<div id="uploadtext">');
     $wgOut->addWikiText(wfMsg('uploadtext'));
     $wgOut->addHTML('</div>');
     $sk = $wgUser->getSkin();
     $sourcefilename = wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsgWikiHtml('fileuploadsummary');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     // WERELATE - added licenseHelp
     $licenseHelpUrl = $sk->makeInternalOrExternalUrl(wfMsgForContent('licensehelppage'));
     $licenseHelp = '<a target="helpwindow" href="' . $licenseHelpUrl . '">' . htmlspecialchars(wfMsg('licensehelp')) . '</a>';
     // WERELATE - added code to select proper license
     if ($this->mLicense) {
         $protectedLicense = str_replace(array('\\', '$', '^', '.', '[', ']', '|', '(', ')', '?', '*', '+', '{', '}', '-'), array('\\\\', '\\$', '\\^', '\\.', '\\[', '\\]', '\\|', '\\(', '\\)', '\\?', '\\*', '\\+', '\\{', '\\}', '\\-'), $this->mLicense);
         $licenseshtml = preg_replace('$value="(' . $protectedLicense . ')"$', 'value="$1" selected="selected"', $licenseshtml);
     }
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = Title::makeTitle(NS_SPECIAL, 'Upload');
     // WERELATE: added target and id
     $query = '';
     if ($this->mTarget) {
         $query = 'target=' . urlencode($this->mTarget) . '&id=' . urlencode($this->mId);
     }
     $action = $titleObj->escapeLocalURL($query);
     $encDestFile = htmlspecialchars($this->mDestFile);
     //WERELATE - added watchcreations
     $watchChecked = $wgUser->getOption('watchdefault') || $wgUser->getOption('watchcreations') ? 'checked="checked"' : '';
     // WERELATE - add scripts
     global $wgScriptPath;
     $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/autocomplete.10.js\"></script>");
     $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/image.1.js\"></script>");
     // WERELATE: removed tabindexes; added id to table
     $wgOut->addHTML("\n\t<form id='upload' method='post' enctype='multipart/form-data' action=\"{$action}\">\n\t\t<table id='image_form_table' border='0'>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile ? "" : "onchange='fillDestFilename()' ") . "size='40' />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t</tr>");
     // WERELATE - added check to omit fields in case of a re-upload, since they're ignored
     $treecheckboxeshtml = '';
     if (!$this->mReUploading) {
         $wgOut->addHTML("\n\t\t<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n\t\t<tr><td>&nbsp;</td><td align='left'><b>License and copyright</b></td></tr>\n\t\t<tr>");
         if ($licenseshtml != '') {
             global $wgStylePath;
             $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wpLicense'>{$license} (&nbsp;{$licenseHelp}&nbsp;):</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<script type='text/javascript' src=\"{$wgStylePath}/common/upload.2.js\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' \n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
         }
         if ($wgUseCopyrightUpload) {
             $filestatus = wfMsgHtml('filestatus');
             $copystatus = htmlspecialchars($this->mUploadCopyStatus);
             $filesource = wfMsgHtml('filesource');
             $uploadsource = htmlspecialchars($this->mUploadSource);
             $wgOut->addHTML("\n\t\t\t        <td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>{$filestatus}:</label></td>\n\t\t\t        <td><input type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"{$copystatus}\" size='40' /></td>\n\t\t        </tr>\n\t\t\t<tr>\n\t\t        \t<td align='right'><label for='wpUploadCopyStatus'>{$filesource}:</label></td>\n\t\t\t        <td><input type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"{$uploadsource}\" size='40' /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
         }
         // WERELATE: added fields
         $personTbl = $this->toForm($this->mPeople, 'person', NS_PERSON, true);
         $familyTbl = $this->toForm($this->mFamilies, 'family', NS_FAMILY, true);
         $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wrCopyright'>Copyright holder:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input type='text' name='wrCopyright' id='wrCopyright' size='30' value=\"" . htmlspecialchars($this->mCopyright) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n\t\t<tr><td>&nbsp;</td><td align='left'><b>Time place and people</b></td></tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wrDate'>Image date:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input type='text' name='wrDate' id='wrDate' size='15' value=\"" . htmlspecialchars($this->mDate) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wrPlace'>Place:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input class='place_input' type='text' name='wrPlace' id='wrDate' size='30' value=\"" . htmlspecialchars($this->mPlace) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' valign='top'>Person page:</td>\n\t\t\t<td align='left'>{$personTbl}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td align='left'><a id='person_link' href='javascript:void(0)' onClick='addImagePage(\"person\"); return preventDefaultAction(event);'>Add another person</a></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' valign='top'>Family page:</td>\n\t\t\t<td align='left'>{$familyTbl}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td align='left'><a id='family_link' href='javascript:void(0)' onClick='addImagePage(\"family\"); return preventDefaultAction(event);'>Add another family</a></td>\n\t\t</tr>\n\t\t");
         // WERELATE - move description from above; end reUploading if statement; moved summary label
         //            add id for wpUpload; added tree checkboxes
         //!!! remove this code dependency before sharing
         require_once "extensions/familytree/FamilyTreeUtil.php";
         $t = null;
         if ($this->mDestFile) {
             $t = Title::newFromText($this->mDestFile, NS_IMAGE);
         }
         $treecheckboxeshtml = FamilyTreeUtil::generateTreeCheckboxes($wgUser, $t, true);
         $wgOut->addHtml("\n\t\t\t<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n\t\t\t<tr><td></td><td align='left'><b>{$summary}</b></td></tr>\n\t\t\t<tr><td></td><td align='left'>\n\t\t\t\t<textarea name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars($this->mUploadDescription) . "</textarea>\n\t\t\t</td>\n\t\t</tr> ");
     }
     $wgOut->addHTML("\n\t\t<tr>\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthis') . "</label>\n\t\t\t<input type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>" . $treecheckboxeshtml . "\n\t\t</td>\n\t</tr>\n\t<tr>\n\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'><input type='submit' id='wpUpload' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>");
 }
    /**
     * Displays the main upload form, optionally with a highlighted
     * error message up at the top.
     *
     * @param string $msg as HTML
     * @access private
     */
    function mainUploadForm($msg = '')
    {
        global $wgOut, $wgUser, $wgContLang;
        global $wgUseCopyrightUpload, $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
        global $wgRequest, $wgAllowCopyUploads;
        global $wgStylePath, $wgStyleVersion;
        $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
        $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview;
        $adc = wfBoolToStr($useAjaxDestCheck);
        $alp = wfBoolToStr($useAjaxLicensePreview);
        $wgOut->addScript("<script type=\"text/javascript\">\nwgAjaxUploadDestCheck = {$adc};\nwgAjaxLicensePreview = {$alp};\n</script>\n<script type=\"text/javascript\" src=\"{$wgStylePath}/common/upload.js?{$wgStyleVersion}\"></script>\n\t\t");
        if (!wfRunHooks('UploadForm:initial', array(&$this))) {
            wfDebug("Hook 'UploadForm:initial' broke output of the upload form");
            return false;
        }
        if ($this->mDesiredDestName) {
            $title = Title::makeTitleSafe(NS_IMAGE, $this->mDesiredDestName);
            // Show a subtitle link to deleted revisions (to sysops et al only)
            if ($title instanceof Title && ($count = $title->isDeleted()) > 0 && $wgUser->isAllowed('deletedhistory')) {
                $link = wfMsgExt($wgUser->isAllowed('delete') ? 'thisisdeleted' : 'viewdeleted', array('parse', 'replaceafter'), $wgUser->getSkin()->makeKnownLinkObj(SpecialPage::getTitleFor('Undelete', $title->getPrefixedText()), wfMsgExt('restorelink', array('parsemag', 'escape'), $count)));
                $wgOut->addHtml("<div id=\"contentSub2\">{$link}</div>");
            }
            // Show the relevant lines from deletion log (for still deleted files only)
            if ($title instanceof Title && $title->isDeleted() > 0 && !$title->exists()) {
                $this->showDeletionLog($wgOut, $title->getPrefixedText());
            }
        }
        $cols = intval($wgUser->getOption('cols'));
        if ($wgUser->getOption('editwidth')) {
            $width = " style=\"width:100%\"";
        } else {
            $width = '';
        }
        if ('' != $msg) {
            $sub = wfMsgHtml('uploaderror');
            $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
        }
        $wgOut->addHTML('<div id="uploadtext">');
        $wgOut->addWikiMsg('uploadtext', $this->mDesiredDestName);
        $wgOut->addHTML("</div>\n");
        # Print a list of allowed file extensions, if so configured.  We ignore
        # MIME type here, it's incomprehensible to most people and too long.
        global $wgCheckFileExtensions, $wgStrictFileExtensions, $wgFileExtensions, $wgFileBlacklist;
        if ($wgCheckFileExtensions) {
            $delim = wfMsgExt('comma-separator', array('escapenoentities'));
            if ($wgStrictFileExtensions) {
                # Everything not permitted is banned
                $wgOut->addHTML('<div id="mw-upload-permitted">' . wfMsgWikiHtml('upload-permitted', implode($wgFileExtensions, $delim)) . "</div>\n");
            } else {
                # We have to list both preferred and prohibited
                $wgOut->addHTML('<div id="mw-upload-preferred">' . wfMsgWikiHtml('upload-preferred', implode($wgFileExtensions, $delim)) . "</div>\n" . '<div id="mw-upload-prohibited">' . wfMsgWikiHtml('upload-prohibited', implode($wgFileBlacklist, $delim)) . "</div>\n");
            }
        }
        $sourcefilename = wfMsgHtml('sourcefilename');
        $destfilename = wfMsgHtml('destfilename');
        $summary = wfMsgExt('fileuploadsummary', 'parseinline');
        $licenses = new Licenses();
        $license = wfMsgExt('license', array('parseinline'));
        $nolicense = wfMsgHtml('nolicense');
        $licenseshtml = $licenses->getHtml();
        $ulb = wfMsgHtml('uploadbtn');
        $titleObj = SpecialPage::getTitleFor('Upload');
        $action = $titleObj->escapeLocalURL();
        $encDestName = htmlspecialchars($this->mDesiredDestName);
        $watchChecked = $wgUser->getOption('watchdefault') || $wgUser->getOption('watchcreations') && $this->mDesiredDestName == '' ? 'checked="checked"' : '';
        $warningChecked = $this->mIgnoreWarning ? 'checked' : '';
        // Prepare form for upload or upload/copy
        if ($wgAllowCopyUploads && $wgUser->isAllowed('upload_by_url')) {
            $filename_form = "<input type='radio' id='wpSourceTypeFile' name='wpSourceType' value='file' " . "onchange='toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\")' checked />" . "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . "onfocus='" . "toggle_element_activation(\"wpUploadFileURL\",\"wpUploadFile\");" . "toggle_element_check(\"wpSourceTypeFile\",\"wpSourceTypeURL\")'" . ($this->mDesiredDestName ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />" . wfMsgHTML('upload_source_file') . "<br/>" . "<input type='radio' id='wpSourceTypeURL' name='wpSourceType' value='web' " . "onchange='toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\")' />" . "<input tabindex='1' type='text' name='wpUploadFileURL' id='wpUploadFileURL' " . "onfocus='" . "toggle_element_activation(\"wpUploadFile\",\"wpUploadFileURL\");" . "toggle_element_check(\"wpSourceTypeURL\",\"wpSourceTypeFile\")'" . ($this->mDesiredDestName ? "" : "onchange='fillDestFilename(\"wpUploadFileURL\")' ") . "size='40' DISABLED />" . wfMsgHtml('upload_source_url');
        } else {
            $filename_form = "<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDesiredDestName ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />" . "<input type='hidden' name='wpSourceType' value='file' />";
        }
        if ($useAjaxDestCheck) {
            $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'>&nbsp;</td></tr>";
            $destOnkeyup = 'onkeyup="wgUploadWarningObj.keypress();"';
        } else {
            $warningRow = '';
            $destOnkeyup = '';
        }
        $encComment = htmlspecialchars($this->mComment);
        $align1 = $wgContLang->isRTL() ? 'left' : 'right';
        $align2 = $wgContLang->isRTL() ? 'right' : 'left';
        $wgOut->addHTML(<<<EOT
\t<form id='upload' method='post' enctype='multipart/form-data' action="{$action}">
\t\t<table border='0'>
\t\t<tr>
\t  {$this->uploadFormTextTop}
\t\t\t<td align='{$align1}' valign='top'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
\t\t\t<td align='{$align2}'>
\t\t\t\t{$filename_form}
\t\t\t</td>
\t\t</tr>
\t\t<tr>
\t\t\t<td align='{$align1}'><label for='wpDestFile'>{$destfilename}:</label></td>
\t\t\t<td align='{$align2}'>
\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' 
\t\t\t\t\tvalue="{$encDestName}" {$destOnkeyup} />
\t\t\t</td>
\t\t</tr>
\t\t<tr>
\t\t\t<td align='{$align1}'><label for='wpUploadDescription'>{$summary}</label></td>
\t\t\t<td align='{$align2}'>
\t\t\t\t<textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' 
\t\t\t\t\tcols='{$cols}'{$width}>{$encComment}</textarea>
\t   {$this->uploadFormTextAfterSummary}
\t\t\t</td>
\t\t</tr>
\t\t<tr>
EOT
);
        if ($licenseshtml != '') {
            global $wgStylePath;
            $wgOut->addHTML("\n\t\t\t<td align='{$align1}'><label for='wpLicense'>{$license}:</label></td>\n\t\t\t<td align='{$align2}'>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='4'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t<option value=''>{$nolicense}</option>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>");
            if ($useAjaxLicensePreview) {
                $wgOut->addHtml("\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td id=\"mw-license-preview\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>");
            }
        }
        if ($wgUseCopyrightUpload) {
            $filestatus = wfMsgHtml('filestatus');
            $copystatus = htmlspecialchars($this->mCopyrightStatus);
            $filesource = wfMsgHtml('filesource');
            $uploadsource = htmlspecialchars($this->mCopyrightSource);
            $wgOut->addHTML("\n\t\t\t        <td align='{$align1}' nowrap='nowrap'><label for='wpUploadCopyStatus'>{$filestatus}:</label></td>\n\t\t\t\t\t<td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' \n\t\t\t\t\t  value=\"{$copystatus}\" size='40' /></td>\n\t\t        </tr>\n\t\t\t<tr>\n\t\t        \t<td align='{$align1}'><label for='wpUploadCopyStatus'>{$filesource}:</label></td>\n\t\t\t\t\t<td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' \n\t\t\t\t\t  value=\"{$uploadsource}\" size='40' /></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
        }
        $wgOut->addHtml("\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthisupload') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' {$warningChecked}/>\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t{$warningRow}\n\t<tr>\n\t\t<td></td>\n\t\t<td align='{$align2}'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\"" . $wgUser->getSkin()->tooltipAndAccesskey('upload') . " /></td>\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='{$align2}'>\n\t\t");
        $wgOut->addWikiText(wfMsgForContent('edittools'));
        $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t<input type='hidden' name='wpDestFileWarningAck' id='wpDestFileWarningAck' value=''/>\n\t</form>");
    }