public function __construct() { parent::__construct(); if ($this->loginError) { return; } $this->use_mootools = true; $this->pub =& $_SESSION['pub']; if (isset($this->pub->pub_id)) { $this->page_title = 'Edit Publication'; } // initialize attachments if (!isset($_SESSION['paper']) && !isset($_SESSION['attachments'])) { $_SESSION['paper'] = $this->pub->paperFilenameGet(); if (count($this->pub->additional_info) > 0) { for ($i = 0, $n = count($this->pub->additional_info); $i < $n; $i++) { $_SESSION['attachments'][$i] = $this->pub->attFilenameGet($i); $_SESSION['att_types'][$i] = $this->pub->additional_info[$i]->type; } } } $form = new HTML_QuickForm('add_pub4'); $this->form =& $form; $this->formAddAttachments(); $this->formAddWebLinks(); $this->formRelatedPubs(); $pos = strpos($_SERVER['PHP_SELF'], 'papersdb'); $url = substr($_SERVER['PHP_SELF'], 0, $pos) . 'papersdb'; $form->addGroup(array(HTML_QuickForm::createElement('submit', 'prev_step', '<< Previous Step'), HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => "cancelConfirm();")), HTML_QuickForm::createElement('reset', 'reset', 'Reset'), HTML_QuickForm::createElement('submit', 'finish', 'Finish')), 'buttons', null, ' ', false); if ($form->validate()) { $this->processForm(); } else { $this->renderForm(); } }
public function __construct() { parent::__construct(); if ($this->loginError) { return; } $this->use_mootools = true; $this->pub =& $_SESSION['pub']; if (isset($this->pub->pub_id)) { $this->page_title = 'Edit Publication'; } $this->authors = pdAuthorList::create($this->db, null, null, true); $form = new HTML_QuickForm('add_pub2', 'post', '', '', array('onsubmit' => 'return check_authors("add_pub2");')); $form->addElement('header', null, 'Select from Authors in Database'); $tooltip = 'Authors::The authors of the publication. Listed in the same order as in the publication <p/> If an author is not already in the database press the <b>Add Author not in DB</b> button.'; $form->addElement('textarea', 'authors', "<div id=\"MYCUSTOMFLOATER\" class=\"myCustomFloater\" style=\"position:absolute;top:200px;left:600px;background-color:#cecece;display:none;visibility:hidden\"><div class=\"myCustomFloaterContent\"></div></div>" . "<span class=\"Tips1\" title=\"{$tooltip}\">Authors</span>:", array('cols' => 60, 'rows' => 5, 'class' => 'wickEnabled:MYCUSTOMFLOATER', 'wrap' => 'virtual')); $form->addElement('static', null, null, '<span class="small">' . 'There are ' . count($this->authors) . ' authors in the database. Type a partial name to ' . 'see a list of matching authors. Separate names ' . 'using commas.</span>'); $form->addElement('submit', 'add_new_author', 'Add Author not in DB'); // collaborations radio selections $tooltip = 'Collaborations::If the publication is a collaboration, select the options that apply to this paper.'; $form->addElement('header', null, "<span class=\"Tips1\" title=\"{$tooltip}\">Collaborations</span>"); $collaborations = pdPublication::collaborationsGet($this->db); foreach ($collaborations as $col_id => $description) { $radio_cols[] = HTML_QuickForm::createElement('checkbox', 'paper_col[' . $col_id . ']', null, $description, 1); } $form->addGroup($radio_cols, 'group_collaboration', null, '<br/>', false); $pos = strpos($_SERVER['PHP_SELF'], 'papersdb'); $url = substr($_SERVER['PHP_SELF'], 0, $pos) . 'papersdb'; $buttons[] = HTML_QuickForm::createElement('submit', 'prev_step', '<< Previous Step'); $buttons[] = HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => "cancelConfirm();")); $buttons[] = HTML_QuickForm::createElement('submit', 'next_step', 'Next Step >>'); if ($this->pub->pub_id != '') { $buttons[] = HTML_QuickForm::createElement('submit', 'finish', 'Finish'); } $form->addGroup($buttons, 'buttons', '', ' ', false); $this->form =& $form; if ($form->validate()) { $this->processForm(); } else { $this->renderForm(); } }
public function __construct() { parent::__construct(); if ($this->loginError) { return; } $this->use_mootools = true; $this->loadHttpVars(true, false); $this->pub =& $_SESSION['pub']; if (isset($this->pub->pub_id)) { $this->page_title = 'Edit Publication'; } if (empty($this->venue_id) && is_object($this->pub->venue) && !empty($this->pub->venue->venue_id)) { $this->venue_id = $this->pub->venue->venue_id; } if (isset($this->venue_id)) { if ($this->venue_id >= 0) { $this->pub->addVenue($this->db, $this->venue_id); } else { $this->pub->venue = null; } } if (isset($this->cat_id)) { $this->pub->addCategory($this->db, $this->cat_id); } else { if (is_object($this->pub->category)) { $this->cat_id = $this->pub->category->cat_id; } } $this->addPubDisableMenuItems(); $form = new HTML_QuickForm('add_pub3'); $form->addElement('header', null, 'Category Information'); // category $category_list = pdCatList::create($this->db); $category[] = HTML_QuickForm::createElement('select', 'cat_id', null, array('' => '--- Please Select a Category ---') + $category_list, array('onchange' => 'dataKeep();')); $text = ''; if (is_object($this->pub->venue) && is_object($this->pub->category) && $this->pub->venue->cat_id != 0 && $this->pub->venue->cat_id != $this->pub->category->cat_id) { $text = '<span class="emph">(venue default is: ' . $category_list[$this->pub->venue->cat_id] . ')</span>'; } $category[] = HTML_QuickForm::createElement('static', null, null, $text); $tooltip = 'Category::The type of publication entry being submitted to the database. For example this could be a conference paper, a journal entry, a book chapter, etc. <p/> Select the appropriate category from the drop down menu'; $form->addGroup($category, null, "<span class=\"Tips1\" title=\"{$tooltip}\">Category</span>:", ' ', false); // Venue if (is_object($this->pub->category) && in_array($this->cat_id, array(1, 3, 4))) { $vlist = pdVenueList::create($this->db, array('cat_id' => $this->cat_id, 'concat' => true)); } else { $vlist = pdVenueList::create($this->db, array('concat' => true)); } $venues[''] = '--Select Venue--'; $venues['-1'] = '--No Venue--'; // check if user info has 'Venues previously used by me' checked if ($this->used_by_me == 'yes') { $user =& $_SESSION['user']; $user->venueIdsGet($this->db); foreach ($vlist as $venue_id => $name) { if (isset($user->venue_ids[$venue_id])) { $venues[$venue_id] = htmlentities($name); } } } else { foreach ($vlist as $venue_id => $name) { $venues[$venue_id] = htmlentities($name); } } $tooltip = 'Venue::Where the paper was published -- specific journal, conference, workshop, etc. If many of the database papers are in the same venue, you can create a single <b>label</b> for that venue, to specify name of the venue, location, date, editors and other common information. You will then be able to use and re-use that information.'; $form->addElement('select', 'venue_id', "<span class=\"Tips1\" title=\"{$tooltip}\">Venue</span>:", $venues, array('style' => 'width: 70%;', 'onchange' => 'dataKeep();')); $form->addElement('submit', 'add_venue', 'Add New Venue'); $form->addElement('advcheckbox', 'used_by_me', null, 'Only show venues previously used by me', array('onchange' => 'dataKeep();'), array('', 'yes')); // rankings radio selections $rankings = pdPublication::rankingsGlobalGet($this->db); foreach ($rankings as $rank_id => $description) { $text = $description; if (is_object($this->pub->venue)) { if ($this->pub->venue->rank_id == $rank_id) { $text .= ' <span class="emph">(venue default)</span>'; } } else { if (is_object($this->pub->category) && ($this->pub->category->cat_id == 1 && $rank_id == 2 || $this->pub->category->cat_id == 3 && $rank_id == 2 || $this->pub->category->cat_id == 4 && $rank_id == 3)) { $text .= ' <span class="emph">(category default)</span>'; } } $radio_rankings[] = HTML_QuickForm::createElement('radio', 'paper_rank', null, $text, $rank_id); } $radio_rankings[] = HTML_QuickForm::createElement('radio', 'paper_rank', null, 'other (fill in box below)', -1); $radio_rankings[] = HTML_QuickForm::createElement('text', 'paper_rank_other', null, array('size' => 30, 'maxlength' => 250)); $tooltip = 'Ranking::Select the ranking of the venue. If the venue is already in the database the ranking should be selected automatically. Sometimes the paper may have a ranking different from the venue ranking.'; $form->addGroup($radio_rankings, 'group_rank', "<span class=\"Tips1\" title=\"{$tooltip}\">Ranking</span>:", '<br/>', false); if ($this->cat_id > 0 && is_object($this->pub->category) && is_array($this->pub->category->info) && count($this->pub->category->info) > 0) { foreach ($this->formInfoElementsGet() as $element => $name) { $form->addElement('text', $element, $name . ':', array('size' => 50, 'maxlength' => 250)); } } $tooltip = 'Date::The date the publication was published.'; $form->addElement('date', 'pub_date', "<span class=\"Tips1\" title=\"{$tooltip}\">Date</span>:", array('format' => 'YM', 'minYear' => pdPublication::MIN_YEAR, 'maxYear' => pdPublication::MAX_YEAR)); $form->addElement('header', 'other_info', 'Other information', null); $tooltip = 'Extra Information::Specify auxiliary information to help classify this publication. Eg, "with student" or "best paper", etc. <p/> Note: by default this information will NOT be shown when this publication entry is displayed.'; $form->addElement('textarea', 'extra_info', "<span class=\"Tips1\" title=\"{$tooltip}\">Extra Information</span>:", array('cols' => 60, 'rows' => 5)); $form->addElement('static', null, null, '<span class="small">' . 'Separate using semicolons.' . ' See help text for examples of what goes here ' . '(use mouse to hover over \'Extra Information\' ' . 'text).' . '</span>'); $pos = strpos($_SERVER['PHP_SELF'], 'papersdb'); $url = substr($_SERVER['PHP_SELF'], 0, $pos) . 'papersdb'; $buttons[] = HTML_QuickForm::createElement('submit', 'prev_step', '<< Previous Step'); $buttons[] = HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => "cancelConfirm();")); $buttons[] = HTML_QuickForm::createElement('reset', 'reset', 'Reset'); $buttons[] = HTML_QuickForm::createElement('submit', 'next_step', 'Next Step >>'); if ($this->pub->pub_id != '') { $buttons[] = HTML_QuickForm::createElement('submit', 'finish', 'Finish'); } $form->addGroup($buttons, 'buttons', '', ' ', false); $this->form =& $form; if ($form->validate()) { $this->processForm(); } else { $this->renderForm(); } }
/** * Constructor. * */ public function __construct() { parent::__construct(); if ($this->loginError) { return; } $this->loadHttpVars(true, false); $this->use_mootools = true; if (isset($_SESSION['pub'])) { // according to session variables, we are already editing a // publication $this->pub =& $_SESSION['pub']; } else { if ($this->pub_id != '') { // pub_id passed in with $_GET variable $this->pub = new pdPublication(); $result = $this->pub->dbLoad($this->db, $this->pub_id); if (!$result) { $this->pageError = true; return; } $_SESSION['pub'] =& $this->pub; } else { // create a new publication $this->pub = new pdPublication(); $_SESSION['pub'] =& $this->pub; } } if ($this->pub->pub_id != '') { $this->page_title = 'Edit Publication'; } $form = new HTML_QuickForm('add_pub1'); $form->addElement('header', null, 'Add Publication'); // title $form->addElement('text', 'title', '<span class="Tips1" title="Title::The title of the publication.">Title:</span>', array('size' => 60, 'maxlength' => 250)); $form->addRule('title', 'please enter a title', 'required', null, 'client'); $tooltip = 'Abstract::If available, enter the abstract of the document you are submitting. <p/> Plain text or HTML text (using HTML tags) can be used.'; $form->addElement('textarea', 'abstract', "<span class=\"Tips1\" title=\"{$tooltip}\">Abstract</span>:<br/><div class=\"small\">HTML Enabled</div>", array('cols' => 60, 'rows' => 10)); $tooltip = 'Keywords::Enter keywords that describe your paper and could possibly be used to find your paper by other users searching the database. You may want to enter multiple terms that are associated with your document. <p/> <i><b>If your paper is Machine Learning related please put \'mahcine learning\' here.</b></i> <p/> Examples may include words like: medical imaging; robotics; data mining.'; $form->addGroup(array(HTML_QuickForm::createElement('text', 'keywords', null, array('size' => 60, 'maxlength' => 250)), HTML_QuickForm::createElement('static', 'kwgroup_help', null, '<span class="small">separate using semi-colons (;)</span>')), 'kwgroup', "<span class=\"Tips1\" title=\"{$tooltip}\">Keywords:</span>", '<br/>', false); $tooltip = 'User Info::A place for the user to enter his/her own information'; $form->addElement('textarea', 'user', "<span class=\"Tips1\" title=\"{$tooltip}\">User Info:</span>", array('cols' => 60, 'rows' => 2)); $buttons[] = HTML_QuickForm::createElement('button', 'cancel', 'Cancel', array('onclick' => "cancelConfirm();")); $buttons[] = HTML_QuickForm::createElement('reset', 'reset', 'Reset'); $buttons[] = HTML_QuickForm::createElement('submit', 'step2', '>> Step 2'); $buttons[] = HTML_QuickForm::createElement('submit', 'step3', '>> Step 3'); $buttons[] = HTML_QuickForm::createElement('submit', 'step4', '>> Step 4'); if ($this->pub->pub_id != '') { $buttons[] = HTML_QuickForm::createElement('submit', 'finish', 'Finish'); } $form->addGroup($buttons, 'buttons', '', ' ', false); $this->db =& $this->db; $this->form =& $form; if ($form->validate()) { $this->processForm(); } else { $this->renderForm(); } }