Exemplo n.º 1
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>General information</B>'), 'hr', array('Transcript Ensembl ID', '', 'text', 'id_ensembl', 10), array('Protein Ensembl ID', '', 'text', 'id_protein_ensembl', 10), array('Protein Uniprot ID', '', 'text', 'id_protein_uniprot', 10), array('Remarks', '', 'textarea', 'remarks', 50, 5), 'hr', 'skip');
     return parent::getForm();
 }
Exemplo n.º 2
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     // Each type must have a picture named lovd_form_<type>.png, of 16x16 pixels.
     $aTypes = array('information' => 'Information', 'question' => 'Question', 'warning' => 'Warning');
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>Announcement details</B>'), array('Announcement type', '', 'select', 'type', 1, $aTypes, false, false, false), array('Announcement text', '', 'textarea', 'announcement', 60, 5), array('Start date', 'Use this field to create an announcement before it should be online. The announcement will be active only after this date and time. If you leave this field empty, the current time will be selected. To deactivate an announcement, put a date in the future, like 9999-12-31.', 'text', 'start_date', 20), array('End date', 'Use this field to automatically let an announcement disappear at a certain date or time. If you leave this field empty, the end date will be set to 9999-12-31 23:59:59.', 'text', 'end_date', 20), array('Make LOVD read-only?', 'Enabling this feature blocks logins and submitter registrations when this announcement is active. Only Managers and up will still be able to log into LOVD. Users of a lower level that are active when this announcement activates, will be logged out. A true read-only state is currently not enforced; Managers can still make changes to all data.<BR>Use this feature when the server is undergoing maintenance, for instance.', 'checkbox', 'lovd_read_only'), 'skip', 'authorization' => array('Enter your password for authorization', '', 'password', 'password', 20));
     return parent::getForm();
 }
Exemplo n.º 3
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     global $_SETT;
     $aHumanBuilds = array();
     foreach ($_SETT['human_builds'] as $sCode => $aBuild) {
         $aHumanBuilds[$sCode] = $sCode . ' / ' . $aBuild['ncbi_name'];
     }
     // No more hg18! We'll support LOVDs having this setting, but we won't allow new installations to pick this setting.
     unset($aHumanBuilds['hg18']);
     $aFeedHistory = array('Not available');
     for ($i = 1; $i <= 12; $i++) {
         $aFeedHistory[$i] = $i . ' month' . ($i == 1 ? '' : 's');
     }
     $this->aFormData = array(array('POST', '', '', '', '335', '14', ''), array('', '', 'print', '<B>General system settings</B>'), 'hr', array('Title of this LOVD installation', 'This will be shown on the top of every page.', 'text', 'system_title', 45), array('Institute (optional)', 'The institute which runs this database is displayed in the public area and in emails sent by LOVD. It\'s commonly set to a laboratory name or a website name.', 'text', 'institute', 45), array('Database URL (optional)', 'This is the URL with which the database can be accessed by the outside world, including "http://" or "https://". It will also be used in emails sent by LOVD. This field is mandatory if you select the "Include in the global LOVD listing" option.<BR>If you click the "check" link, LOVD will verify or try to predict the value.', 'print', '<INPUT type="text" name="location_url" size="40" id="location_url" value="' . (empty($_POST['location_url']) ? '' : htmlspecialchars($_POST['location_url'])) . '"' . (!lovd_errorFindField('location_url') ? '' : ' class="err"') . '>&nbsp;<SPAN id="location_url_check">(<A href="#" onclick="javascript:lovd_checkURL(); return false;">check</A>)</SPAN>'), array('LOVD email address', 'This email address will be used to send emails from LOVD to users. We need this address to make sure that emails from LOVD arrive. Please note that although strictly speaking this email address does not need to exist, we recommend that you use a valid address.', 'text', 'email_address', 40), array('Forward messages to database admin?', 'This will forward messages to the database administrator about submitter registrations and submissions.', 'checkbox', 'send_admin_submissions'), 'refseq_build' => array('Human Build to map to (UCSC/NCBI)', 'We need to know which version of the Human Build we need to map the variants in this LOVD to.', 'select', 'refseq_build', 1, $aHumanBuilds, false, false, false), array('List database changes in feed for how long?', 'LOVD includes a "newsfeed" that allows users to get a list of changes recently made in the database. Select here how many months back you want changes to appear on this list. Set to "Not available" to disable the newsfeed.', 'print', '&nbsp;<I style="color : #666666;">Not yet implemented</I>'), 'hr', 'skip', 'skip', array('', '', 'print', '<B>Connection settings (optional)</B>'), array('', '', 'note', 'The following settings apply to how LOVD connects to other resources.<BR>Some networks have no access to the outside world except through a proxy. If this applies to the network this server is installed on, please fill in the proxy server information here.'), 'hr', array('Proxy server host name', 'The host name of the proxy server, such as www-cache.institution.edu.', 'text', 'proxy_host', 20), array('Proxy server port number', 'The port number of the proxy server, such as 3128.', 'text', 'proxy_port', 4), 'skip', array('', '', 'note', 'The following two fields only apply if the proxy server requires authentication.'), array('Proxy server username', 'In case the proxy server requires authentication, please enter the required username here.', 'text', 'proxy_username', 20), array('Proxy server password', 'In case the proxy server requires authentication, please enter the required password here.', 'password', 'proxy_password', 20, true), 'hr', 'skip', 'skip', array('', '', 'print', '<B>Customize LOVD</B>'), array('', '', 'note', 'Here you can customize the way LOVD looks. We will add more options here later.'), 'hr', array('System logo', 'If you wish to have your custom logo on the top left of every page instead of the default LOVD logo, enter the path to the image here, relative to the LOVD installation path.', 'text', 'logo_uri', 40), array('', '', 'note', 'Currently, only images already uploaded to the LOVD server are allowed here.'), 'hr', 'skip', 'skip', array('', '', 'print', '<B>Global LOVD statistics</B>'), array('', '', 'note', 'The following settings apply to the kind of information your LOVD install sends to the development team to gather statistics about global LOVD usage.'), 'hr', array('Send statistics?', 'This sends <I>anonymous</I> statistics about the number of submitters, genes, individuals and variants in your installation of LOVD.', 'checkbox', 'send_stats'), array('Include in the global LOVD listing?', 'We keep a public listing of LOVD installations, their genes and their URLs. Deselect this checkbox if you do not want to be included in this public listing.', 'checkbox', 'include_in_listing'), 'hr', 'skip', 'skip', array('', '', 'print', '<B>Security settings</B>'), array('', '', 'note', 'Using the following settings you can control some security settings of LOVD.'), 'hr', array('Allow submitter registration?', 'Enabling this setting allows submitters to create their own accounts in your LOVD installation. Having it enabled is the default setting, and this could not be disabled prior to LOVD 3.0-17.<BR>Note, that submitters can never register when your LOVD installation is set to read-only because of an active announcement with the read-only setting enabled. See the Announcements section in the Setup area for more information.', 'checkbox', 'allow_submitter_registration'), array('Lock users after 3rd failed login?', 'Do you want to lock users (submitters, curators and managers) after three failed attempts to log in using their username?<BR>(This does <I>not</I> affect the database administrator account)', 'checkbox', 'lock_users'), array('Allow (locked) users to retrieve a new password?', 'Do you want to enable an "I forgot my password" option that allows users who forgot their password to retrieve a new one?', 'checkbox', 'allow_unlock_accounts'), array('Enable submitters to change data?', 'Enabling this setting allows submitters to make changes to data previously submitted by them or assigned to them.', 'checkbox', 'allow_submitter_mods'), array('Enable getting counts of hidden entries?', 'Enabling this feature allows the public to find the number of entries in the database (including hidden entries) matching one or more search terms on a specified set of columns. This feature will only mention the number of variant entries matched, without showing them.', 'print', '&nbsp;<I style="color : #666666;">Not yet implemented</I>'), array('Force SSL-only access to LOVD?', 'SSL is a secure protocol allowing for encryption of data sent between you and LOVD. When you will record sensitive individual information in LOVD, you <B>should</B> enable this setting, as the individual information can otherwise be \'sniffed\' off the network. If you do not record sensitive information, enabling SSL is <I>recommended</I>.', 'checkbox', 'use_ssl'), array('Use data versioning of biological data?', 'Versioning allows you to see all previous versions of a certain data entry (individuals, variants, phenotype information, etc) and allows you to return the entry to a previous state. Please note that this feature requires quite a lot of space in the database. Disabling this feature later will not free any space, just prevent more space from being used.', 'print', '&nbsp;<I style="color : #666666;">Not yet implemented</I>'), 'uninstall' => array('Disable LOVD uninstall?', 'Select this to disable the "Uninstall LOVD" option in the Setup area. Please note that this uninstall lock can only be removed by directly accessing the MySQL database.', 'checkbox', 'lock_uninstall'), 'uninstall_hr' => 'hr');
     if (lovd_getProjectFile() != '/install/index.php') {
         unset($this->aFormData['uninstall'], $this->aFormData['uninstall_hr']);
         global $_CONF;
         $this->aFormData['refseq_build'] = array('Human Build to map to (UCSC/NCBI)', '', 'print', '&nbsp;' . $_CONF['refseq_build']);
     }
     return parent::getForm();
 }
Exemplo n.º 4
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     global $_PE, $_DB;
     // Get links list, to connect column to link.
     $aLinks = $_DB->query('SELECT id, name FROM ' . TABLE_LINKS . ' ORDER BY name')->fetchAllCombine();
     $nLinkSize = count($aLinks);
     $nLinkSize = $nLinkSize < 10 ? $nLinkSize : 10;
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>Column name and descriptions</B>'), 'hr', 'category' => array('', '', 'print', '<I>Selected category: ' . $_POST['category'] . '</I>'), 'colid' => array('Column ID', '', 'text', 'colid', 30), 'colid_note' => array('', '', 'note', 'This ID must be unique and may contain only letters, numbers and underscores. Subcategories must be divided by a slash (/), such as \'{{ EXAMPLE }}\'.'), array('Column heading', 'This will appear above the column in data tables.', 'text', 'head_column', 30), array('Description on short legend<BR>(HTML enabled)', '', 'textarea', 'description_legend_short', 40, 2), array('Description on full legend<BR>(HTML enabled)', '', 'textarea', 'description_legend_full', 40, 4), array('', '', 'note', 'The full legend description will also serve as help text. In create and edit forms where this custom column is present, the text will be shown when someone hovers their mouse over the blue question mark next to the input field.'), 'hr', 'skip', array('', '', 'print', '<B>Data and form settings</B> (Use data type wizard to change values)'), 'hr', array('', '', 'print', '<BUTTON type="button" onclick="javascript:lovd_openWindow(\'' . lovd_getInstallURL() . $_PE[0] . '?data_type_wizard&amp;workID=' . $_POST['workID'] . '\', \'DataTypeWizard\', 800, 400); return false;">Start data type wizard</BUTTON>'), array('MySQL data type', '<B>Experts only!</B> Only change this field manually when you know what you\'re doing! Otherwise, use the data type wizard by clicking the button above this field.', 'text', 'mysql_type', 30), array('Form type', '<B>Experts only!</B> Only change this field manually when you know what you\'re doing! Otherwise, use the data type wizard by clicking the button above the MySQL data type field.', 'text', 'form_type', 30), 'hr', 'skip', array('', '', 'print', '<B>Column settings</B>'), 'hr', 'settings_note' => array('', '', 'print', '<I>Please note that fields marked with * are merely default values. For each configured {{ DATATYPE }}, these values may be changed at any later time.</I>'), 'standard' => array('Include this column for newly configured ', '', 'checkbox', 'standard'), 'width' => array('Column display width in pixels', '', 'text', 'width', 5), array('', '', 'print', '<IMG src="gfx/trans.png" alt="" width="' . (int) $_POST['width'] . '" height="3" style="background : #000000;"><BR><SPAN class="form_note">(This is ' . (int) $_POST['width'] . ' pixels)</SPAN>'), 'mandatory' => array('Mandatory field', '', 'checkbox', 'mandatory'), 'public_view' => array('Show contents to public', '', 'checkbox', 'public_view'), 'public_add' => array('Show field on submission form', '', 'checkbox', 'public_add'), 'hr', 'skip', 'active_links_title' => array('', '', 'print', '<B>Link settings</B>'), 'active_links_hr1' => 'hr', 'active_links' => array('Active custom links', '', 'select', 'active_links', $nLinkSize, $aLinks, false, true, true), 'active_links_hr2' => 'hr', 'active_links_skip' => 'skip', 'apply_to_all' => array('Apply changes to all {{ UNIT }} where this column is active', '', 'checkbox', 'apply_to_all'), array('Enter your password for authorization', '', 'password', 'password', 20));
     // Change some text on the form.
     switch ($_POST['category']) {
         case 'Individual':
             unset($this->aFormData['settings_note']);
             unset($this->aFormData['standard']);
             unset($this->aFormData['apply_to_all']);
             $this->aFormData['colid_note'][3] = str_replace('{{ EXAMPLE }}', 'Geograpic_origin/Country', $this->aFormData['colid_note'][3]);
             break;
         case 'Phenotype':
             $this->aFormData['settings_note'][3] = str_replace('{{ DATATYPE }}', 'disease', $this->aFormData['settings_note'][3]);
             $this->aFormData['standard'][0] .= 'diseases';
             $this->aFormData['colid_note'][3] = str_replace('{{ EXAMPLE }}', 'Blood_pressure/Systolic', $this->aFormData['colid_note'][3]);
             $this->aFormData['width'][0] .= ' *';
             $this->aFormData['mandatory'][0] .= ' *';
             $this->aFormData['public_view'][0] .= ' *';
             $this->aFormData['public_add'][0] .= ' *';
             $this->aFormData['apply_to_all'][0] = str_replace('{{ UNIT }}', 'diseases', $this->aFormData['apply_to_all'][0]);
             break;
         case 'Screening':
             unset($this->aFormData['settings_note']);
             unset($this->aFormData['standard']);
             unset($this->aFormData['apply_to_all']);
             $this->aFormData['colid_note'][3] = str_replace('{{ EXAMPLE }}', 'Protocol/Date_updated', $this->aFormData['colid_note'][3]);
             break;
         case 'VariantOnGenome':
             unset($this->aFormData['settings_note']);
             unset($this->aFormData['standard']);
             unset($this->aFormData['apply_to_all']);
             $this->aFormData['colid_note'][3] = str_replace('{{ EXAMPLE }}', 'Frequency/dbSNP', $this->aFormData['colid_note'][3]);
             // FIXME; I think this example sucks.
             break;
         case 'VariantOnTranscript':
             $this->aFormData['settings_note'][3] = str_replace('{{ DATATYPE }}', 'gene', $this->aFormData['settings_note'][3]);
             $this->aFormData['standard'][0] .= 'genes';
             $this->aFormData['colid_note'][3] = str_replace('{{ EXAMPLE }}', 'Protein/Codon', $this->aFormData['colid_note'][3]);
             $this->aFormData['width'][0] .= ' *';
             $this->aFormData['mandatory'][0] .= ' *';
             $this->aFormData['public_view'][0] .= ' *';
             $this->aFormData['public_add'][0] .= ' *';
             $this->aFormData['apply_to_all'][0] = str_replace('{{ UNIT }}', 'genes', $this->aFormData['apply_to_all'][0]);
             break;
     }
     // Het hele formulier moet anders met het editen... het display gedeelte moet apart denk ik - "edit display settings"; variant en phenotype cols hebben "set defaults for new genes/diseases", alle hebben "edit data types" ofzo.
     if (ACTION == 'edit') {
         if (!preg_match('/^TEXT|VARCHAR/', $_POST['mysql_type']) || $_PE[2] == 'DBID') {
             unset($this->aFormData['active_links_title'], $this->aFormData['active_links_hr1'], $this->aFormData['active_links'], $this->aFormData['active_links_hr2'], $this->aFormData['active_links_skip']);
         }
         unset($this->aFormData['colid'], $this->aFormData['colid_note']);
     } elseif (ACTION == 'create') {
         unset($this->aFormData['apply_to_all']);
     }
     return parent::getForm();
 }
Exemplo n.º 5
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>Column descriptions</B>'), 'hr', array('Description on short legend<BR>(HTML enabled)', '', 'textarea', 'description_legend_short', 50, 2), array('Description on full legend<BR>(HTML enabled)', '', 'textarea', 'description_legend_full', 50, 3), 'hr', 'skip', array('', '', 'print', '<B>Form settings</B>'), array('Notes on form (optional)<BR>(HTML enabled)', '', 'textarea', 'description_form', 50, 2), array('', '', 'note', 'If you think the data field needs clarification on the data entry form, add it here - it will appear below the field on the data entry form just like this piece of text.'), 'options' => array('List of possible options', '', 'textarea', 'select_options', 50, 5), 'options_note' => array('', '', 'note', 'This is used to build the available options for the selection list.<BR>One option per line.<BR>If you want to use abbreviations, use: Abbreviation = Long name<BR>Example: &quot;DMD = Duchenne Muscular Dystrophy&quot;'), 'hr', 'skip', array('', '', 'print', '<B>Column settings</B>'), 'hr', 'width' => array('Column display width in pixels', '', 'text', 'width', 5), array('', '', 'print', '<IMG src="gfx/trans.png" alt="" width="' . (int) $_POST['width'] . '" height="3" style="background : #000000;"><BR><SPAN class="form_note">(This is ' . (int) $_POST['width'] . ' pixels)</SPAN>'), 'mandatory' => array('Mandatory field', '', 'checkbox', 'mandatory'), 'public_view' => array('Show contents to public', '', 'checkbox', 'public_view'), 'public_add' => array('Show field on submission form', '', 'checkbox', 'public_add'), 'hr', 'skip', array('Enter your password for authorization', '', 'password', 'password', 20));
     return parent::getForm();
 }
Exemplo n.º 6
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     global $_AUTH, $_DB, $_SETT, $_PE;
     $aUserLevels = $_SETT['user_levels'];
     $bInstall = lovd_getProjectFile() == '/install/index.php';
     if ($bInstall) {
         // Very special case, we can't take it from the database, because it ain't there yet.
         require ROOT_PATH . 'install/inc-sql-countries.php';
         $aCountryList = array();
         foreach ($aCountrySQL as $sQ) {
             $aCountryList[substr($sQ, 22 + strlen(TABLE_COUNTRIES), 2)] = substr($sQ, 28 + strlen(TABLE_COUNTRIES), -2);
         }
     } else {
         // "Normal" user form; create user, edit user.
         $aCountryList = $_DB->query('SELECT id, name FROM ' . TABLE_COUNTRIES . ' ORDER BY name')->fetchAllCombine();
         if ($_AUTH) {
             // Remove user levels that are higher than or equal to the current user's level IF you are logged in.
             unset($aUserLevels[LEVEL_COLLABORATOR], $aUserLevels[LEVEL_OWNER], $aUserLevels[LEVEL_CURATOR]);
             // Aren't real user levels.
             for ($i = LEVEL_ADMIN; $i >= $_AUTH['level']; $i--) {
                 if (isset($aUserLevels[$i])) {
                     unset($aUserLevels[$i]);
                 }
             }
         }
     }
     // FIXME; this is a mess...!!!
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>User details</B>'), 'hr', array('Name', '', 'text', 'name', 30), array('Institute', '', 'text', 'institute', 40), array('Department (optional)', '', 'text', 'department', 40), array('Postal address', '', 'textarea', 'address', 35, 3), array('Email address(es), one per line', '', 'textarea', 'email', 30, 3), array('Telephone (optional)', '', 'text', 'telephone', 20), 'username' => array('Username', '', 'text', 'username', 20), 'passwd' => array('Password', 'A proper password is at least 4 characters long and contains at least one number or special character.', 'password', 'password_1', 20, true), 'passwd_confirm' => array('Password (confirm)', '', 'password', 'password_2', 20, true), 'passwd_change' => array('Must change password at next logon', '', 'checkbox', 'password_force_change'), 'hr', 'skip', array('', '', 'print', '<B>Referencing the lab</B>'), 'hr', array('Country', '', 'select', 'countryid', 1, $aCountryList, true, false, false), array('City', 'Please enter your city, even if it\'s included in your postal address, for sorting purposes.', 'text', 'city', 30), array('Reference (optional)', 'Your submissions will contain a reference to you in the format "Country:City" by default. You may change this to your preferred reference here.', 'text', 'reference', 30), 'hr', 'skip', array('', '', 'print', '<B>Security</B>'), 'hr', 'level' => array('Level', ($_AUTH['level'] != LEVEL_ADMIN ? '' : '<B>Managers</B> basically have the same rights as you, but can\'t uninstall LOVD nor can they create or edit other Manager accounts.<BR>') . '<B>Submitters</B> can submit, but not publish information in the database. Submitters can also create their own accounts, you don\'t need to do this for them.<BR><BR>In LOVD 3.0, <B>Curators</B> are Submitter-level users with Curator rights on certain genes. To create a Curator account, you need to create a Submitter and then grant this user rights on the necessary genes.', 'select', 'level', 1, $aUserLevels, false, false, false), array('Allowed IP address list (optional)', 'To help prevent others to try and guess the username/password combination, you can restrict access to the account to a number of IP addresses or ranges.', 'text', 'allowed_ip', 20), array('', '', 'note', 'Default value: *<BR>' . (strpos($_SERVER['REMOTE_ADDR'], ':') !== false ? '' : '<I>Your current IP address: ' . $_SERVER['REMOTE_ADDR'] . '</I><BR>') . '<B>Please be extremely careful using this setting.</B> Using this setting too strictly, can deny the user access to LOVD, even if the correct credentials have been provided.<BR>Set to \'*\' to allow all IP addresses, use \'-\' to specify a range and use \';\' to separate addresses or ranges.'), 'locked' => array('Locked', '', 'checkbox', 'locked'), 'hr', 'authorization_skip' => 'skip', 'send_email' => array('Send email with account details to user', '', 'checkbox', 'send_email'), 'authorization' => array('Enter your password for authorization', '', 'password', 'password', 20));
     if ($bInstall || ACTION != 'create') {
         unset($this->aFormData['send_email']);
     }
     if ($bInstall || ACTION == 'register') {
         // No need to ask for the user's password when the user is not created yet.
         unset($this->aFormData['authorization_skip'], $this->aFormData['authorization']);
     }
     if ($bInstall || !empty($_PE[1]) && $_PE[1] == $_AUTH['id'] || ACTION == 'register') {
         // Some fields not allowed when creating/editing your own account.
         unset($this->aFormData['passwd_change'], $this->aFormData['level'], $this->aFormData['locked']);
     }
     if (ACTION == 'edit') {
         unset($this->aFormData['username']);
         $this->aFormData['passwd'] = str_replace('Password', 'New password (optional)', $this->aFormData['passwd']);
         $this->aFormData['passwd_confirm'] = str_replace('Password (confirm)', 'New password (confirm, optional)', $this->aFormData['passwd_confirm']);
     } elseif (ACTION == 'change_password' && !$bInstall) {
         // Sorry, seems easier to just redefine the whole thing.
         $this->aFormData = array(array('POST', '', '', '', '50%', '14', '50%'), 'change_self' => array('Current password', '', 'password', 'password', 20), array('New password', '', 'password', 'password_1', 20, true), array('New password (confirm)', '', 'password', 'password_2', 20, true), 'skip', 'change_other' => array('Enter your password for authorization', '', 'password', 'password', 20));
         if ($_PE[1] == $_AUTH['id']) {
             unset($this->aFormData['change_other']);
         } else {
             unset($this->aFormData['change_self']);
         }
     }
     return parent::getForm();
 }
Exemplo n.º 7
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     global $_DB, $_AUTH, $_SETT;
     // Get list of genes, to connect disease to gene.
     if ($_AUTH['level'] == LEVEL_CURATOR) {
         $aGenes = $_AUTH['curates'];
         if (ACTION == 'edit') {
             global $zData;
             // 2016-09-08; 3.0-17; Don't forget to run array_values() since a missing key results in a query error... :|
             $aGenes = array_values(array_unique(array_merge($aGenes, $zData['genes'])));
         }
         $aGenesForm = $_DB->query('SELECT id, name FROM ' . TABLE_GENES . ' WHERE id IN (?' . str_repeat(', ?', count($aGenes) - 1) . ') ORDER BY id', $aGenes)->fetchAllCombine();
     } else {
         $aGenesForm = $_DB->query('SELECT id, name FROM ' . TABLE_GENES . ' ORDER BY id')->fetchAllCombine();
     }
     $nData = count($aGenesForm);
     foreach ($aGenesForm as $sID => $sGene) {
         $aGenesForm[$sID] = $sID . ' (' . lovd_shortenString($sGene, 50) . ')';
     }
     if (!$nData) {
         $aGenesForm = array('' => 'No gene entries available');
     }
     $nFieldSize = count($aGenesForm) < 15 ? count($aGenesForm) : 15;
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>Disease information</B>'), 'hr', array('Disease abbreviation', '', 'text', 'symbol', 15), array('Disease name', '', 'text', 'name', 40), array('OMIM ID (optional)', '', 'text', 'id_omim', 10), array('Associated tissues', '', 'select', 'tissues', 10, $_SETT['disease_tissues'], false, true, false), array('Disease features', '', 'textarea', 'features', 50, 5), array('Remarks', '', 'textarea', 'remarks', 50, 5), 'hr', 'skip', array('', '', 'print', '<B>Relation to genes (optional)</B>'), 'hr', 'aGenes' => array('This disease has been linked to these genes', '', 'select', 'genes', $nFieldSize, $aGenesForm, false, true, false), 'hr', 'skip');
     return parent::getForm();
 }
Exemplo n.º 8
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         if (lovd_getProjectFile() == '/import.php') {
             // During import the refseq_genomic is required, else the import
             // starts complaining that the selected refseq_genomic is not valid
             // Therefore we set the refseq_genomic in the aFormData property
             // before the getForm() is returned.
             global $zData;
             $aSelectRefseqGenomic = array_combine(array($zData['refseq_genomic']), array($zData['refseq_genomic']));
             $this->aFormData['refseq_genomic'] = array('Genomic reference sequence', '', 'select', 'refseq_genomic', 1, $aSelectRefseqGenomic, false, false, false);
         }
         return parent::getForm();
     }
     global $_DB, $zData, $_SETT;
     // Get list of diseases.
     $aDiseasesForm = $_DB->query('SELECT id, IF(CASE symbol WHEN "-" THEN "" ELSE symbol END = "", name, CONCAT(symbol, " (", name, ")")) FROM ' . TABLE_DISEASES . ' WHERE id > 0 ORDER BY (symbol != "" AND symbol != "-") DESC, symbol, name')->fetchAllCombine();
     $nDiseases = count($aDiseasesForm);
     if (!$nDiseases) {
         $aDiseasesForm = array('' => 'No disease entries available');
         $nDiseasesFormSize = 1;
     } else {
         $aDiseasesForm = array_combine(array_keys($aDiseasesForm), array_map('lovd_shortenString', $aDiseasesForm, array_fill(0, $nDiseases, 75)));
         $nDiseasesFormSize = $nDiseases < 15 ? $nDiseases : 15;
     }
     // References sequences (genomic and transcripts).
     if (lovd_getProjectFile() == '/import.php') {
         $aSelectRefseqGenomic = array_combine(array($zData['refseq_genomic']), array($zData['refseq_genomic']));
     } else {
         $aSelectRefseqGenomic = array_combine($zData['genomic_references'], $zData['genomic_references']);
     }
     $aTranscriptNames = array();
     $aTranscriptsForm = array();
     if (!empty($zData['transcripts'])) {
         foreach ($zData['transcripts'] as $sTranscript) {
             // Until revision 679 the transcript version was not used in the index and removed with preg_replace.
             // Can not figure out why version is not included. Therefore, for now we will do without preg_replace.
             if (!isset($aTranscriptNames[$sTranscript])) {
                 $aTranscriptsForm[$sTranscript] = lovd_shortenString($zData['transcriptNames'][$sTranscript], 50);
                 $aTranscriptsForm[$sTranscript] .= str_repeat(')', substr_count($aTranscriptsForm[$sTranscript], '(')) . ' (' . $sTranscript . ')';
             }
         }
         asort($aTranscriptsForm);
     } else {
         $aTranscriptsForm = array('' => 'No transcripts available');
     }
     $nTranscriptsFormSize = count($aTranscriptsForm);
     $nTranscriptsFormSize = $nTranscriptsFormSize < 10 ? $nTranscriptsFormSize : 10;
     $aSelectRefseq = array('c' => 'Coding DNA', 'g' => 'Genomic');
     $aSelectDisclaimer = array(0 => 'No', 1 => 'Use standard LOVD disclaimer', 2 => 'Use own disclaimer (enter below)');
     $aSelectHeaderFooter = array(-1 => 'Left', 0 => 'Center', 1 => 'Right');
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>General information</B>'), 'hr', array('Full gene name', '', 'print', $zData['name'], 50), array('Official gene symbol', '', 'print', $zData['id']), array('Chromosome', '', 'print', $zData['chromosome']), array('Chromosomal band', '', 'text', 'chrom_band', 10), array('Imprinting', 'Please note:<BR>Maternally imprinted (expressed from the paternal allele)<BR>Paternally imprinted (expressed from the maternal allele)', 'select', 'imprinting', 1, $_SETT['gene_imprinting'], false, false, false), array('Date of creation (optional)', 'Format: YYYY-MM-DD. If left empty, today\'s date will be used.', 'text', 'created_date', 10), 'hr', 'skip', array('', '', 'print', '<B>Relation to diseases (optional)</B>'), 'hr', array('This gene has been linked to these diseases', 'Listed are all disease entries currently configured in LOVD.', 'select', 'active_diseases', $nDiseasesFormSize, $aDiseasesForm, false, true, false), array('', '', 'note', 'Diseases not in this list are not yet configured in this LOVD.<BR>Do you want to <A href="#" onclick="lovd_openWindow(\'' . lovd_getInstallURL() . 'diseases?create&amp;in_window\', \'DiseasesCreate\', 800, 550); return false;">configure more diseases</A>?'), 'hr', 'skip', array('', '', 'print', '<B>Reference sequences (mandatory)</B>'), array('', '', 'note', 'Collecting variants requires a proper reference sequence. Without a genomic and a transcript reference sequence the variants in this LOVD database cannot be interpreted properly or mapped to the genome.'), 'hr', 'refseq_genomic' => array('Genomic reference sequence', '', 'select', 'refseq_genomic', 1, $aSelectRefseqGenomic, false, false, false), array('', '', 'note', 'Select the genomic reference sequence (NG, NC, LRG accession number). Only the references that are available to LOVD are shown.'), 'transcripts' => array('Transcript reference sequence(s)', 'Select transcript references (NM accession numbers).', 'select', 'active_transcripts', $nTranscriptsFormSize, $aTranscriptsForm, false, true, false), 'hr', 'skip', array('', '', 'print', '<B>Links to information sources (optional)</B>'), array('', '', 'note', 'Here you can add links that will be displayed on the gene\'s LOVD gene homepage.'), 'hr', array('Homepage URL', '', 'text', 'url_homepage', 40), array('', '', 'note', 'If you have a separate homepage about this gene, you can specify the URL here. Format: complete URL, including "http://".'), array('External links', '', 'textarea', 'url_external', 55, 3), array('', '', 'note', 'Here you can provide links to other resources on the internet that you would like to link to. One link per line, format: complete URLs or "Description &lt;URL&gt;".'), array('HGNC ID', '', 'print', $zData['id_hgnc']), array('Entrez Gene (Locuslink) ID', '', 'print', $zData['id_entrez'] ? $zData['id_entrez'] : 'Not Available'), array('OMIM Gene ID', '', 'print', $zData['id_omim'] ? $zData['id_omim'] : 'Not Available'), array('Provide link to HGMD', 'Do you want a link to this gene\'s entry in the Human Gene Mutation Database added to the homepage?', 'checkbox', 'show_hgmd'), array('Provide link to GeneCards', 'Do you want a link to this gene\'s entry in the GeneCards database added to the homepage?', 'checkbox', 'show_genecards'), array('Provide link to GeneTests', 'Do you want a link to this gene\'s entry in the GeneTests database added to the homepage?', 'checkbox', 'show_genetests'), array('This gene has a human-readable reference sequence', '', 'select', 'refseq', 1, $aSelectRefseq, 'No', false, false), array('', '', 'note', 'Although GenBank files are the official reference sequence, they are not very readable for humans. If you have a human-readable format of your reference sequence online, please select the type here.'), array('Human-readable reference sequence location', '', 'text', 'refseq_url', 40), 'refseqparse_new' => array('', '', 'note', 'If you are going to use our <A href="#" onclick="lovd_openWindow(\'' . lovd_getInstallURL() . 'scripts/refseq_parser.php\', \'RefSeqParser\', 800, 500); return false;">Reference Sequence Parser</A> to create a human-readable reference sequence, the result will be located at "' . lovd_getInstallURL() . 'refseq/' . $zData['id'] . '_codingDNA.html".'), 'refseqparse_edit' => array('', '', 'note', 'If you used our <A href="#" onclick="lovd_openWindow(\'' . lovd_getInstallURL() . 'scripts/refseq_parser.php?symbol=' . $zData['id'] . '\', \'RefSeqParser\', 800, 500); return false;">Reference Sequence Parser</A> to create a human-readable reference sequence, the result is located at "' . lovd_getInstallURL() . 'refseq/' . $zData['id'] . '_codingDNA.html".'), 'hr', 'skip', array('', '', 'print', '<B>Customizations (optional)</B>'), array('', '', 'note', 'You can use the following fields to customize the gene\'s LOVD gene homepage.'), 'hr', array('Citation reference(s)', '', 'textarea', 'reference', 30, 3), array('', '', 'note', '(Active custom link : <A href="#" onmouseover="lovd_showToolTip(\'Click to insert:<BR>{PMID:[1]:[2]}<BR><BR>Links to abstracts in the PubMed database.<BR>[1] = The name of the author(s).<BR>[2] = The PubMed ID.\');" onmouseout="lovd_hideToolTip();" onclick="lovd_insertCustomLink(this, \'{PMID:[1]:[2]}\'); return false">Pubmed</A>)'), array('Include disclaimer', '', 'select', 'disclaimer', 1, $aSelectDisclaimer, false, false, false), array('', '', 'note', 'If you want a disclaimer added to the gene\'s LOVD gene homepage, select your preferred option here.'), array('Text for own disclaimer<BR>(HTML enabled)', '', 'textarea', 'disclaimer_text', 55, 3), array('', '', 'note', 'Only applicable if you choose to use your own disclaimer (see option above).'), array('Page header<BR>(HTML enabled)', '', 'textarea', 'header', 55, 3), array('', '', 'note', 'Text entered here will appear above all public gene-specific pages.'), array('Header aligned to', '', 'select', 'header_align', 1, $aSelectHeaderFooter, false, false, false), array('Page footer<BR>(HTML enabled)', '', 'textarea', 'footer', 55, 3), array('', '', 'note', 'Text entered here will appear below all public gene-specific pages.'), array('Footer aligned to', '', 'select', 'footer_align', 1, $aSelectHeaderFooter, false, false, false), array('Notes for the LOVD gene homepage<BR>(HTML enabled)', '', 'textarea', 'note_index', 55, 3), array('', '', 'note', 'Text entered here will appear in the General Information box on the gene\'s LOVD gene homepage.'), array('Notes for the variant listings<BR>(HTML enabled)', '', 'textarea', 'note_listing', 55, 3), array('', '', 'note', 'Text entered here will appear below the gene\'s variant listings.'), 'hr', 'skip', array('', '', 'print', '<B>Security settings</B>'), array('', '', 'note', 'Using the following settings you can control some security settings of LOVD.'), 'hr', array('Allow public to download variant entries', '', 'checkbox', 'allow_download'), array('Allow my public variant and individual data to be indexed by WikiProfessional', '', 'checkbox', 'allow_index_wiki'), 'hr', 'skip');
     if (ACTION == 'edit') {
         $this->aFormData['transcripts'] = array('Transcriptomic reference sequence(s)', '', 'note', 'To add, remove or edit transcriptomic reference sequences for this gene, please see the gene\'s detailed view.');
         unset($this->aFormData['refseqparse_new']);
     } else {
         unset($this->aFormData['refseqparse_edit']);
     }
     return parent::getForm();
 }
Exemplo n.º 9
0
 function getForm()
 {
     // Build the form.
     // If we've built the form before, simply return it. Especially imports will repeatedly call checkFields(), which calls getForm().
     if (!empty($this->aFormData)) {
         return parent::getForm();
     }
     global $_DB;
     // Get column list, to connect link to column.
     $aData = array();
     $sLastCategory = '';
     $zData = $_DB->query('SELECT id, CONCAT(id, " (", head_column, ")") FROM ' . TABLE_COLS . ' WHERE mysql_type LIKE \'VARCHAR%\' OR mysql_type LIKE \'TEXT%\' ORDER BY id')->fetchAllCombine();
     $nData = count($zData);
     $nFieldSize = $nData < 20 ? $nData : 20;
     // Print active columns list ourselves, because we want to apply styling in the selection box.
     $sSelect = '<SELECT name="active_columns[]" size="' . $nFieldSize . '" multiple>';
     foreach ($zData as $key => $val) {
         $sCategory = substr($key, 0, strpos($key, '/'));
         if ($sCategory != $sLastCategory) {
             // Weird trick; we need to work around the safety measures in lovd_viewForm() to do this;
             $aData[$sCategory . '" style="font-weight : bold; color : #FFFFFF; background : #224488; text-align : center;'] = ucfirst($sCategory) . ' columns';
             $sLastCategory = $sCategory;
             $aData[$key] = $val;
         } else {
             // Implement the safety measures normally present in lovd_viewForm().
             $aData[htmlspecialchars($key)] = htmlspecialchars($val);
         }
     }
     foreach ($aData as $key => $val) {
         $sSelect .= "\n" . '              <OPTION value="' . $key . '"' . (!empty($_POST['active_columns']) && in_array($key, $_POST['active_columns']) ? ' selected' : '') . '>' . $val . '</OPTION>';
     }
     $sSelect .= '</SELECT>';
     // Array which will make up the form table.
     $this->aFormData = array(array('POST', '', '', '', '35%', '14', '65%'), array('', '', 'print', '<B>Link details</B>'), array('Link name', '', 'text', 'name', 30), array('Pattern', '', 'text', 'pattern_text', 30), array('', '', 'note', 'The pattern is bound to some rules:<UL style="margin : 0px; padding-left : 1.5em;"><LI>It must start with \'{\' and end with \'}\'.</LI><LI>It can contain letters, numbers, spaces, some special characters (:;,_-) and references ([1] to [9]).</LI><LI>It must be 3-25 characters long.</LI><LI>Two or more references directly after each other must be separated by at least one character to keep the two apart.</LI></UL>'), array('Replacement text', '', 'textarea', 'replace_text', 40, 3), array('', '', 'note', 'Make sure you use all references from the pattern in the replacement text.'), array('Link description', 'To aid other users in using your custom link, please provide some information on what the link is for and how to use the references.', 'textarea', 'description', 40, 5), 'skip', array('', '', 'print', '<B>Link settings</B>'), array('Active for columns', '', 'print', $sSelect), 'skip', 'authorization' => array('Enter your password for authorization', '', 'password', 'password', 20));
     if (ACTION != 'edit') {
         unset($this->aFormData['authorization']);
     }
     return parent::getForm();
 }