Plugin Directory

Changeset 2170467


Ignore:
Timestamp:
10/09/2019 08:45:35 AM (6 years ago)
Author:
hitcode
Message:

4.4.9

Location:
shiftcontroller/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • shiftcontroller/trunk/hc3/_wordpress/layout.php

    r1851180 r2170467  
    1212    {
    1313        $content = '' . $content;
     14
     15        $content = str_replace( 'hc-table-header-wpadmin', '', $content );
     16        $content = str_replace( 'hc-table-header', '', $content );
    1417
    1518        $body = array();
  • shiftcontroller/trunk/hc3/ui/element/input/datepicker/assets/input.css

    r1851180 r2170467  
    487487  margin-right: -5px;
    488488}
    489 .hc-datepicker2.dropdown-menu {
     489.hc-datepicker2.hc-dropdown-menu {
    490490  position: absolute;
    491491  top: 100%;
     
    523523
    524524}
    525 .hc-datepicker2.dropdown-menu th,
     525.hc-datepicker2.hc-dropdown-menu th,
    526526.hc-datepicker2.hc-datepicker2-inline th,
    527 .hc-datepicker2.dropdown-menu td,
     527.hc-datepicker2.hc-dropdown-menu td,
    528528.hc-datepicker2.hc-datepicker2-inline td {
    529529  padding: 4px 5px;
  • shiftcontroller/trunk/hc3/ui/element/input/datepicker/assets/input.js

    r1869916 r2170467  
    107107        }
    108108        else {
    109             this.picker.addClass('hc-datepicker2-dropdown dropdown-menu');
     109            this.picker.addClass('hc-datepicker2-dropdown hc-dropdown-menu');
    110110        }
    111111
  • shiftcontroller/trunk/readme.txt

    r2168986 r2170467  
    6060
    6161== Changelog ==
     62
     63= 4.4.9 =
     64* In the month schedule view the shift widget now displays abbreviated label of the calendar title or of the employee name, depending on the grouping selected.
     65* Modified the permissions part so that if an employee can't see others shifts in a calendar, so this employee can't also see others employees names.
    6266
    6367= 4.4.8 =
  • shiftcontroller/trunk/sh4/schedule/html/view/common.php

    r2120574 r2170467  
    219219        $return = $this->employeesQuery->findActive();
    220220
     221        $currentUser = $this->auth->getCurrentUser();
     222        $currentUserId = $currentUser->getId();
     223        $employee = $this->appQuery->findEmployeeByUser( $currentUser );
     224        $managedCalendars = $this->appQuery->findCalendarsManagedByUser( $currentUser );
     225
    221226        $allowed = array();
     227        if( $employee ){
     228            $allowed[ $employee->getId() ] = $employee;
     229        }
    222230
    223231        $calendars = $this->self->findAllCalendars();
    224232        foreach( $calendars as $calendar ){
    225             $thisReturn = $this->appQuery->findEmployeesForCalendar( $calendar );
    226             $allowed = $allowed + $thisReturn;
     233            $thisCalendarId = $calendar->getId();
     234
     235            $thisAllowed = $this->appQuery->findEmployeesForCalendar( $calendar );
     236
     237            if( isset($managedCalendars[$thisCalendarId]) ){
     238                $allowed = $allowed + $thisAllowed;
     239                continue;
     240            }
     241
     242        // OPEN?
     243            if( isset($thisAllowed[0]) ){
     244                $permNames = array();
     245                $permNames[] = 'visitor_view_open_publish';
     246                $permNames[] = 'visitor_view_open_draft';
     247                if( $employee ){
     248                    $permNames[] = 'employee_view_open_publish';
     249                    $permNames[] = 'employee_view_open_draft';
     250                }
     251
     252                reset( $permNames );
     253                foreach( $permNames as $permName ){
     254                    $perm = $this->calendarsPermissions->get( $calendar, $permName );
     255                    if( $perm ){
     256                        $allowed[0] = $thisAllowed[0];
     257                        break;
     258                    }
     259                }
     260            }
     261
     262            $permNames = array();
     263            $permNames[] = 'visitor_view_others_publish';
     264            $permNames[] = 'visitor_view_others_draft';
     265            if( $employee ){
     266                $permNames[] = 'employee_view_others_publish';
     267                $permNames[] = 'employee_view_others_draft';
     268            }
     269
     270            reset( $permNames );
     271            foreach( $permNames as $permName ){
     272                $perm = $this->calendarsPermissions->get( $calendar, $permName );
     273                if( $perm ){
     274                    $allowed = $allowed + $thisAllowed;
     275                    break;
     276                }
     277            }
     278
     279        // PICKUP?
     280            if( $employee ){
     281                $permNames = array();
     282                $permNames[] = 'employee_pickup_others';
     283
     284                reset( $permNames );
     285                foreach( $permNames as $permName ){
     286                    $perm = $this->calendarsPermissions->get( $calendar, $permName );
     287                    if( $perm ){
     288                        $allowed = $allowed + $thisAllowed;
     289                        break;
     290                    }
     291                }
     292            }
     293
     294            // $allowed = $allowed + $thisReturn;
    227295        }
    228296
  • shiftcontroller/trunk/sh4/schedule/html/view/month.php

    r2149207 r2170467  
    701701        foreach( $shifts as $shift ){
    702702            $id = $shift->getId();
    703             $thisView = $this->widget->renderCompact( $shift );
     703            $thisView = $this->widget->renderCompact( $shift, $iknow );
    704704
    705705            if( ! $noZoom ){
  • shiftcontroller/trunk/sh4/shifts/view/widget.php

    r2134277 r2170467  
    164164    }
    165165
    166     public function renderCompact( SH4_Shifts_Model $model )
     166    public function renderCompact( SH4_Shifts_Model $model, $iknow = array() )
    167167    {
    168168        $id = $model->getId();
    169169        $calendar = $model->getCalendar();
    170170        $color = $calendar->getColor();
     171        $employee = $model->getEmployee();
    171172
    172173        $out = ' ';
    173         $out = $this->ui->makeBlock( $out )
     174
     175        $label = NULL;
     176
     177        if( ! in_array('calendar', $iknow) ){
     178            $label = $calendar->getTitle();
     179        }
     180        elseif( ! in_array('employee', $iknow) ){
     181            $label = $employee->getTitle();
     182        }
     183
     184        if( NULL !== $label ){
     185            $label = explode( ' ', $label );
     186
     187            $finalLabel = array();
     188            foreach( $label as $l ){
     189                $l = substr( $l, 0, 1 );
     190                $finalLabel[] = $l;
     191                if( count($finalLabel) >= 2 ){
     192                    break;
     193                }
     194            }
     195
     196            $label = join( '', $finalLabel );
     197        }
     198        else {
     199            $label = ' ';
     200        }
     201
     202        $out = $this->ui->makeBlock( $label )
    174203            ->padding(1)
    175204            ->tag('nowrap')
     205            ->tag('align', 'center')
     206            // ->tag('font-size', 2)
    176207            ;
    177208
  • shiftcontroller/trunk/shiftcontroller4.php

    r2164188 r2170467  
    44 * Plugin URI: http://www.shiftcontroller.com/
    55 * Description: Staff scheduling plugin
    6  * Version: 4.4.8
     6 * Version: 4.4.9
    77 * Author: hitcode.com
    88 * Author URI: http://www.shiftcontroller.com/
     
    1111*/
    1212
    13 define( 'SH4_VERSION', 448 );
     13define( 'SH4_VERSION', 449 );
    1414
    1515if (! defined('ABSPATH')) exit; // Exit if accessed directly
Note: See TracChangeset for help on using the changeset viewer.