Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8365 | Rev 15371 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 8365 Rev 15150
Línea 103... Línea 103...
103
                $surveyMapper = SurveyFormMapper::getInstance($this->adapter);
103
                $surveyMapper = SurveyFormMapper::getInstance($this->adapter);
104
                $paginator = $surveyMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
104
                $paginator = $surveyMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
Línea 105... Línea 105...
105
 
105
 
106
                $items = [];
106
                $items = [];
-
 
107
                $records = $paginator->getCurrentItems();
-
 
108
                
-
 
109
                $acl = $this->getEvent()->getViewModel()->getVariable('acl');
-
 
110
                $allowEdit = $acl->isAllowed($currentUser->usertype_id, 'survey/form/edit');
-
 
111
                $allowDelete = $acl->isAllowed($currentUser->usertype_id, 'survey/form/delete');
Línea 107... Línea 112...
107
                $records = $paginator->getCurrentItems();
112
                
Línea 108... Línea 113...
108
              
113
              
109
                foreach ($records as $record) {
114
                foreach ($records as $record) {
110
                   
115
                   
111
                    $item = [
116
                    $item = [
112
                        'id' => $record->id,
117
                        'id' => $record->id,
113
                        'name' => $record->name,
118
                        'name' => $record->name,
114
                        'status' => $record->status,
119
                        'status' => $record->status,
115
                        'actions' => [
120
                        'actions' => [
116
                            'link_edit' => $this->url()->fromRoute('survey/form/edit', ['id' => $record->uuid]),
121
                            'link_edit' => $allowEdit ? $this->url()->fromRoute('survey/form/edit', ['id' => $record->uuid]) : '',
Línea 117... Línea 122...
117
                            'link_delete' => $this->url()->fromRoute('survey/form/delete', ['id' => $record->uuid])
122
                            'link_delete' => $allowDelete ? $this->url()->fromRoute('survey/form/delete', ['id' => $record->uuid]) : '',
118
                        ]
123
                        ]