global $db; $task_id = (int)$this -> task['id']; $task_attachments = ( isset( $this -> task_attachments ) and is_array( $this -> task_attachments ) ) ? $this -> task_attachments : []; $attachments_count = count( $task_attachments ); $date_start = ''; if ( $this -> task['date_start'] ) $date_start = date( 'Y-m-d', strtotime( $this -> task['date_start'] ) ); elseif ( !$this -> task['id'] ) $date_start = date( 'Y-m-d' ); $date_end = ''; if ( $this -> task['date_end'] ) $date_end = date( 'Y-m-d', strtotime( $this -> task['date_end'] ) ); elseif ( !$this -> task['id'] ) $date_end = date( 'Y-m-d' ); $projects = [ 0 => '--- wybierz projekt ---' ]; if ( is_array( $this -> projects ) ) foreach ( $this -> projects as $project ) { $projects[ $project[ 'id' ] ] = $project[ 'name' ]; if ( (int)$project['client_id'] ) $projects[ $project['id'] ] .= ' (' . \factory\Crm::get_client_name( (int)$project[ 'client_id' ] ) . ')'; } $project_id = $this -> task['project_id'] ? $this -> task[ 'project_id' ] : 0; if ( !$this -> task['id'] and !$project_id ) $project_id = 72; $clients = [ 0 => '--- wybierz klienta ---' ]; if ( is_array( $this -> clients ) ) foreach ( $this -> clients as $client ) $clients[ $client[ 'id' ] ] = $client[ 'firm' ]; $parent_tasks = [ 0 => '--- wybierz zadanie nadrzędne ---' ]; if ( is_array( $this -> parent_tasks ) ) foreach ( $this -> parent_tasks as $parent_task ) $parent_tasks[ $parent_task[ 'id' ] ] = $parent_task[ 'name' ] . ( $parent_task['client'] ? ' (' . $parent_task['client'] . ')' : '' ); ob_start(); ?> = \Html::input( [ 'label' => 'Nazwa', 'name' => 'name', 'id' => 'name', 'value' => $this -> task[ 'name' ], 'class' => 'require', 'inline' => true ] ); ?> = \Html::textarea( [ 'label' => 'Treść', 'name' => 'text', 'id' => 'text', 'value' => $this -> task[ 'text' ], 'rows' => 10, 'skip_encoding' => true ] ); ?> $tab_basic = ob_get_clean(); ob_start(); ?> = \Html::input([ 'label' => 'Data rozpoczęcia', 'name' => 'date_start', 'id' => 'date_start', 'value' => $date_start, 'class' => 'datetime', 'inline' => true, 'autocomplete' => 'off' ]);?> = \Html::input([ 'label' => 'Data zakończenia', 'name' => 'date_end', 'id' => 'date_end', 'value' => $date_end, 'class' => 'datetime', 'inline' => true, 'autocomplete' => 'off' ]);?> = \Html::select([ 'label' => 'Projekt', 'name' => 'project_id', 'id' => 'project_id', 'value' => $project_id, 'values' => $projects ]);?> = \Html::select( [ 'label' => 'Klient', 'name' => 'client_id', 'id' => 'client_id', 'value' => $this -> task[ 'id' ] ? $this -> task[ 'client_id' ] : 0, 'values' => $clients ] ); ?> = \Html::select( [ 'label' => 'Zadanie nadrzędne', 'name' => 'parent_id', 'id' => 'parent_id', 'value' => $this -> task[ 'parent_id' ], 'values' => $parent_tasks ] ); ?> = \Html::select( [ 'label' => 'Status', 'name' => 'status', 'id' => 'status', 'value' => $this -> task[ 'id' ] ? $this -> task[ 'status' ] : 5, 'values' => \factory\Tasks::get_statuses() ] );?> = \Html::select( [ 'label' => 'Priorytet', 'name' => 'priority', 'id' => 'priority', 'value' => $this -> task[ 'priority' ], 'values' => $this -> priorities ] ); ?> if ( $this -> user['id'] == 1 ):?> = \Html::input([ 'label' => 'Stawka', 'name' => 'pay_rate', 'id' => 'pay_rate', 'value' => $this -> task[ 'pay_rate' ], 'class' => 'price', 'inline' => true, 'autocomplete' => 'off' ]);?> endif;?> $tab_details = ob_get_clean(); ob_start(); ?> = \Html::input_switch( [ 'label' => 'Powiadom o zmianie statusu', 'name' => 'status_change_mail', 'id' => 'status_change_mail', 'checked' => ( $this -> task[ 'status_change_mail' ] or !$this -> task['id'] ) ? true : false, 'type' => 'checkbox' ] ); ?>