php code

 avatar
unknown
php
2 years ago
4.0 kB
3
Indexable
if ($isResponsibleEditor || $isEIC) {
     /*** this code has bug need to be fixed
      module_load_include('inc', 'node', 'node.pages');
      $node->showNotes = true;

      //action history table.
      $form_actions_hitory['history_table'] = get_history($node);
      $node -> content['actions'] = $form_actions_hitory;
      $form_actions_hitory = array('#type' => 'fieldset', '#title' => 'Action History');

      //Get authors table form, where editors can email the authors.
      $node -> content['field_authors_ref'] = drupal_get_form('authors_table_form', $node);
      $node -> content['authors_table'] = "";

      if(isset($node->content['field_decision_letter'])){
        $node->hideit = false;
      }
      $form = drupal_get_form('submit_paper' . '_node_form', $node);
      if($isEIC){

        $node -> content['field_responsible_editor'] = array();

        //embed editor assignment on the paper page.
        $node -> content['field_editor'] = drupal_get_form('assign_editor_form', $form, $node);
      }
      
      //show unapproved comments to responsible editor
      // if($isResponsibleEditor){
      //   $result = db_query('SELECT cid FROM {comment} WHERE nid = :nid', array(':nid' => $node->nid));
      //   $cids = array();
      //   foreach ($result as $record){
      //     if (isset($node->content['comments']['comments'])){
      //       if (!array_key_exists($record->cid, $node->content['comments']['comments'])){
      //         $cids[] = $record->cid;
      //       }
      //     }
      //     else{
      //       $cids[] = $record->cid;
      //     }
      //   }
      //   if(!empty($cids)){
      //     $entities = comment_load_multiple($cids);
      //     $view = entity_view('comment', $entities, 'full');
      //     $node->content['comments']['comments'][] = $view;
      //   }
      // }

      if(!is_approved($node)){
       $node->content['allow_cover'] = drupal_get_form('allow_cover_letter_form', $form, $node);
      }


      /* If the paper is reviewed we don't show these fields on the view page
      if (!isset($node -> taxonomy_vocabulary_1['und']) || (isset($node -> taxonomy_vocabulary_1['und']) && $node -> taxonomy_vocabulary_1['und'][0]['tid'] != 1)) {
        if(isset($node -> taxonomy_vocabulary_1['und']) && $node->field_decision['und'][0]['value'] == 'Accept'){
          $node->showFinalVersionLink = true;
        }
        if($isEIC){
        $node -> content['hide_review'] = drupal_get_form('form_hide_reviews', $node);
	}

      }
      //form that displays selected reviewers
      $node -> content['selectedrev'] = drupal_get_form('selectedrev_form',$node);

      //add the link to edit field through pop up
      if($isEIC){
        $node -> content['update_files'] = array(
                         'markup' => array (
                               '#markup' =>
                                       ('<hr/><a href="' . $base_url . '/node/'. $node->nid .'/edit?mode=onlyfiles"><b>Edit Paper Fields</b></a>')
                                      )
                          );
      }

      $hideFromEditor = true;
      //watchdog('This is the value', $node->field_decision['und'][0]['value']);
      if(isset($node->field_decision['und'][0]['value']) && ($node->field_decision['und'][0]['value'] == NULL || (isset($node->field_approval['und']) && $node->field_approval['und'][0]['value']=='sendback'))){
        //watchdog('got him', 'got him1');
        $hideFromEditor = false;
      }
      if (!(isset($node -> field_decision['und']) && sizeof($node -> field_decision['und']) > 0)) {
        $hideFromEditor =false;
        //$node -> content['decision'] = drupal_get_form('decision_form', $form, $node);
      }
      //Actions links that appears on the paper page. Provides a dropdown to assign reviewers, submit decision.
      if(!is_approved($node)){
      $node -> content['actions_eic'] = getDropDownMenu($node->nid, $hideFromEditor);
      }
     */
    }
Editor is loading...