| @@ -101,21 +101,9 @@ | ||
| 101 | 101 | ; |
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - $countDate = count( $dates ); | |
| 106 | - if( $countDate > 1 ){ | |
| 107 | - if( SH4_ShiftTypes_Model::RANGE_HOURS == $range ){ | |
| 108 | - $label = '__Dates__' . ' (' . $countDate . ')'; | |
| 109 | - } | |
| 110 | - else { | |
| 111 | - $label = '__Dates__'; | |
| 112 | - } | |
| 113 | - } | |
| 114 | - else { | |
| 115 | - $label = '__Date__'; | |
| 116 | - } | |
| 117 | - | |
| 105 | + $label = ( count($dates) > 1 ) ? '__Dates__' : '__Date__'; | |
| 118 | 106 | $datesView = $this->ui->makeLabelled( $label, $datesView ); |
| 119 | 107 | |
| 120 | 108 | $shiftType = $this->shiftTypesQuery->findById( $shiftTypeId ); |
| 121 | 109 | |
| @@ -359,17 +347,9 @@ | ||
| 359 | 347 | $employeesView[] = $thisView; |
| 360 | 348 | } |
| 361 | 349 | |
| 362 | 350 | $employeesView = $this->ui->makeListInline( $employeesView ); |
| 363 | - | |
| 364 | - $countEmployee = count( $employees ); | |
| 365 | - if( $countEmployee > 1 ){ | |
| 366 | - $label = '__Employees__' . ' (' . $countEmployee . ')'; | |
| 367 | - } | |
| 368 | - else { | |
| 369 | - $label = '__Employee__'; | |
| 370 | - } | |
| 371 | - | |
| 351 | + $label = ( count($employees) > 1 ) ? '__Employees__' : '__Employee__'; | |
| 372 | 352 | $employeesView = $this->ui->makeLabelled( $label, $employeesView ); |
| 373 | 353 | |
| 374 | 354 | $out[] = $datesView; |
| 375 | 355 | $out[] = $employeesView; |
| @@ -432,9 +412,8 @@ | ||
| 432 | 412 | |
| 433 | 413 | $to = array( 'new', $calendarId, $shiftTypeId, $dateString, $employeeString ); |
| 434 | 414 | $to = join( '/', $to ); |
| 435 | 415 | $out = $this->ui->makeForm( $to, $out ); |
| 436 | - $out->setAttr( 'enctype', 'multipart/form-data' ); | |
| 437 | 416 | |
| 438 | 417 | $this->layout |
| 439 | 418 | ->setContent( $out ) |
| 440 | 419 | // ->setBreadcrumb( $this->common->breadcrumb($calendarId, $shiftTypeId) ) |
| @@ -448,35 +427,15 @@ | ||
| 448 | 427 | public function buttons( $calendarId, $shiftTypeId, $dateString, $employeeString ) |
| 449 | 428 | { |
| 450 | 429 | $ret = array(); |
| 451 | 430 | |
| 452 | - $countDate = $countEmployee = 1; | |
| 453 | - if( false !== strpos($employeeString, '_') ){ | |
| 454 | - $countEmployee = count( HC3_Functions::unglueArray($employeeString) ); | |
| 455 | - } | |
| 431 | + $noDraft = $this->settings->get('shifts_no_draft') ? TRUE : FALSE; | |
| 456 | 432 | |
| 457 | - if( false !== strpos($dateString, '_') ){ | |
| 458 | - $shiftType = $this->shiftTypesQuery->findById( $shiftTypeId ); | |
| 459 | - $range = $shiftType->getRange(); | |
| 460 | - if( SH4_ShiftTypes_Model::RANGE_HOURS == $range ){ | |
| 461 | - $countDate = count( HC3_Functions::unglueArray($dateString) ); | |
| 462 | - } | |
| 463 | - } | |
| 464 | - | |
| 465 | - $countShift = $countDate * $countEmployee; | |
| 466 | - | |
| 467 | - $noDraft = $this->settings->get('shifts_no_draft') ? true : false; | |
| 468 | - | |
| 469 | 433 | // draft |
| 470 | 434 | if( ! $noDraft ){ |
| 471 | 435 | $to = array( 'new', $calendarId, $shiftTypeId, $dateString, $employeeString, 'draft' ); |
| 472 | 436 | $to = join( '/', $to ); |
| 473 | - $label = '__Create Draft__'; | |
| 474 | - if( $countShift > 1 ){ | |
| 475 | - $label .= ' (' . $countShift . ')'; | |
| 476 | - } | |
| 477 | - | |
| 478 | - $btnDraft = $this->ui->makeInputSubmit( $label ) | |
| 437 | + $btnDraft = $this->ui->makeInputSubmit( '__Create Draft__') | |
| 479 | 438 | ->tag('secondary') |
| 480 | 439 | ->setFormAction( $to ) |
| 481 | 440 | ; |
| 482 | 441 | $ret['draft'] = $btnDraft; |
| @@ -485,11 +444,8 @@ | ||
| 485 | 444 | // publish |
| 486 | 445 | $to = array( 'new', $calendarId, $shiftTypeId, $dateString, $employeeString, 'publish' ); |
| 487 | 446 | $to = join( '/', $to ); |
| 488 | 447 | $label = $noDraft ? '__Post Shift__' : '__Create Published__'; |
| 489 | - if( $countShift > 1 ){ | |
| 490 | - $label .= ' (' . $countShift . ')'; | |
| 491 | - } | |
| 492 | 448 | |
| 493 | 449 | $btnPublish = $this->ui->makeInputSubmit( $label ) |
| 494 | 450 | ->tag('primary') |
| 495 | 451 | ->setFormAction( $to ) |