$class->set($property, $this->_vars->get($property) == '' ? null : $this->_vars->get($property));
}
+ $result = $GLOBALS['skoli_shares']->addShare($class);
+
// Save students
- if ($this->_vars->exists('students')) {
+ if ($this->_vars->exists('students') && $result) {
$driver = &Skoli_Driver::singleton($this->shareid);
$result = $driver->addStudents($this->_vars->get('students'));
if (is_a($result, 'PEAR_Error')) {
}
}
- return $GLOBALS['skoli_shares']->addShare($class);
+ return $result;
}
}
switch ($property) {
case 'start':
case 'end':
- $form->addVariable(_(ucfirst($property)), $property, 'monthdayyear', true, false, null, array());
+ $form->addVariable(_(ucfirst($property)), $property, 'monthdayyear', true, false, null, array(date('Y') - 10));
if ($form->_vars->exists('semester') && isset($this->school['semester']) && is_array($this->school['semester'])) {
foreach ($this->school['semester'] as $semester) {
if ($semester['name'] == $form->_vars->get('semester')) {
break;
}
}
- if (isset($activesemester[$property])) {
+ if (isset($activesemester[$property]) && !is_array($form->_vars->get($property))) {
require_once 'Horde/Date.php';
if ($property == 'start') {
$startdate = 0;