Skip to content
Snippets Groups Projects
Select Git revision
  • b415dd0d29653747f3df7df0ebbd1547d8aa9cd3
  • master default
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.1
  • v2014.0
  • v2013.0
10 results

labcomm_signature.h

Blame
  • Forked from Anders Blomdell / LabComm
    Source project has a limited visibility.
    action.add_edit.php 9.03 KiB
    <?php
    #räksmörgås
    if (!isset($gCms)) exit;
    if (! $this->GetPreference('allow_add',1) == 1) exit;
    if (! $this->CheckPermission('Use ReglerSeminars')) {
      return $this->DisplayErrorPage($id, $params, $returnid,
    				 'ReglerSeminars Access denied');
    }
    
    
    $semDB = SeminarDB::getDB();
    $seminars =  'seminars';
    $persons =  'persons';
    
    //file_put_contents("/tmp/add_edit.txt",print_r($params,TRUE));
    
    echo '<pre>'; print_r($params); echo '</pre>';
    $seminarID = 0;
    if (isset($params['seminarID'])) { $seminarID = $params['seminarID']; }
    
    $twoWeeks = time() + (2* 7 * 24 * 60 * 60);
    $date = date('Y-m-d', $twoWeeks);
    $start = '00:00'; $end = '24:00';
    $title = ''; $room = ''; $extratext = ''; $abstract = '';
    $seminarType = 'Standard';
    $properties = 'standard';
    
    $speakers = array(); $numSpeakers = 0;
    $opponents = array(); $numOpponents = 0;
    $advisors = array();  $numAdvisors = 0;
    $examiners = array(); $numExaminers = 0;
    $chairpersons = array(); $numChairpersons = 0;
    
    
    $roleModels = array('Standard' => array('Speaker'),
    		    'PhD' =>  array('Speaker', 'Opponent', 'Chairperson'),
    		    'Lic Tech' => array('Speaker', 'Opponent', 'Examiner'),
    		    'MSc' => array('Speaker', 'Advisor', 'Examiner'),
    		    'BSc' => array('Speaker', 'Advisor', 'Examiner'),
    		    );
    
    if ($seminarID && !isset($params['add_person'])
        && !isset($params['module_error'])) {
      $seminar = Seminar::getOneSeminar($seminarID);
      //echo '<pre>'; print_r($seminar); echo '</pre>';
      
      $speakers = $seminar->speakers; $numSpeakers = count($speakers);
      $opponents = $seminar->opponents; $numOpponents = count($opponents);
      $advisors = $seminar->advisors; $numAdvisors = count($advisors);
      $examiners = $seminar->examiners; $numExaminers = count($examiners);
      $chairpersons = $seminar->chairpersons;
      $numChairpersons = count($chairpersons);
      $seminarType = $seminar->type;
      $numericType = $seminar->numericType;
      $date = $seminar->isodate; $title = $seminar->title;
      $start = $seminar->start; $end = $seminar->end;
      $room = $seminar->room; $properties = $seminar->properties;
      $abstract = $seminar->abstract;
      $extratext = $seminar->extratext;
      $roles = $roleModels[$seminarType];
    } else {
      $dd = 'date'; if (isset($params[$dd])) { $date = $params[$dd]; }
      $dd = 'start'; if (isset($params[$dd])) { $start = $params[$dd]; }
      $dd = 'end'; if (isset($params[$dd])) { $end = $params[$dd];}
      $dd = 'title'; if (isset($params[$dd])) { $title = $params[$dd]; }
      $dd = 'room'; if (isset($params[$dd])) { $room = $params[$dd]; }
      $dd = 'abstract'; if (isset($params[$dd])) {$abstract = $params[$dd];}
      $dd = 'extratext'; if (isset($params[$dd])) {$extratext = $params[$dd];}
      $dd = 'numericType'; if (isset($params[$dd])) {
        $numericType = $params[$dd];