Esempio n. 1
0
 public function sessionpause($co_degre, $co_modu, $sessid)
 {
     $entry = array('en_attente' => 1, 'session_alert' => 1, 'convoc_sent' => 0, 'status' => 1);
     $condition = array('sess_id' => $sessid);
     $DBWriteStatus = BbCrudController::update('gbb_session', $entry, $condition);
     $routeparameters = array('co_degre' => $co_degre, 'co_modu' => $co_modu);
     return $this->redirect('bb.moduleng', $routeparameters, array('fragment' => 'sessions'));
 }
Esempio n. 2
0
 /**
  * Ajax callback to save journal field.
  */
 public function saveJournalAjax(array &$form, FormStateInterface $form_state)
 {
     $valid = $this->validateJournal($form, $form_state);
     $current_uri = \Drupal::request()->getRequestUri();
     $path_args = array_slice(explode('/', $current_uri), -2, 2);
     $condition = array('co_degre' => $path_args[0], 'co_modu' => explode('?', $path_args[1])[0]);
     $entry = array('organisation' => $form_state->getValue('organisation'));
     $module = BbCrudController::update('gbb_gmodu_plus', $entry, $condition);
     $response = new AjaxResponse();
     return $response;
 }
Esempio n. 3
0
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     // $valid = $this->validateJournal($form, $form_state);
     $current_uri = \Drupal::request()->getRequestUri();
     $path_args = array_slice(explode('/', $current_uri), -2, 2);
     $condition = array('co_degre' => $path_args[0], 'co_modu' => $path_args[1]);
     $entry = array('convoc_info_off' => $form_state->getValue('infospasconvocform')['value']);
     $module = BbCrudController::update('gbb_gmodu_plus', $entry, $condition);
     // drupal_set_message('Submitted.'.$path_args[0].'-'.$path_args[1]);
     // dpm($condition);
     // dpm($entry);
     return TRUE;
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $account = \Drupal::currentUser();
     $entry = array('uid' => $account->id(), 'co_modu' => $form_state->getValue('co_modu'), 'co_degre' => $form_state->getValue('co_degre'), 'date' => $form_state->getValue('date'), 'date_ts' => strtotime($form_state->getValue('date')), 'horaires' => $form_state->getValue('horaires'), 'co_lieu' => $form_state->getValue('lieu'), 'co_resp' => $form_state->getValue('formateur'), 'duree_a_payer' => $form_state->getValue('duree_a_payer'), 'duree_prevue' => $form_state->getValue('duree_prevue'), 'type_paiement' => $form_state->getValue('type_paiement'), 'groupe' => $form_state->getValue('groupe'), 'date_modif' => date("Y-m-d H:i:s"));
     if ($form_state->getValue('sess_id') == 1) {
         // Insert
         $DBWriteStatus = BbCrudController::create('gbb_session', $entry);
     } else {
         // Update
         $entry['sess_id'] = $form_state->getValue('sess_id');
         $DBWriteStatus = BbCrudController::update('gbb_session', $entry, array('sess_id' => $form_state->getValue('sess_id')));
     }
     $form_state->setRedirect('bb.moduleng', array('co_degre' => $form_state->getValue('co_degre'), 'co_modu' => $form_state->getValue('co_modu')), array('fragment' => 'sessions'));
 }