Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 260 Rev 268
Línea 100... Línea 100...
100
 
100
 
101
                if (!in_array($order_direction, ['ASC', 'DESC'])) {
101
                if (!in_array($order_direction, ['ASC', 'DESC'])) {
102
                    $order_direction = 'ASC';
102
                    $order_direction = 'ASC';
Línea 103... Línea 103...
103
                }
103
                }
104
 
-
 
Línea 105... Línea -...
105
                $companySelfEvaluationMapper = CompanySelfEvaluationFormMapper::getInstance($this->adapter);
-
 
106
                $paginator = $companySelfEvaluationMapper->fetchAllDataTableByCompanyId($currentCompany->id, $search, $page, $records_x_page, $order_field, $order_direction);
104
 
107
 
-
 
108
                $items = [];
-
 
109
                $records = $paginator->getCurrentItems();
105
                $queryMapper = QueryMapper::getInstance($this->adapter);
110
                foreach ($records as $record) {
-
 
111
 
106
 
112
                    if ($record->language == CompanySelfEvaluationForm::LANGUAGE_SPANISH) {
-
 
113
                        $language = 'LABEL_SPANISH';
-
 
114
                    } else if ($record->language == CompanySelfEvaluationForm::LANGUAGE_ENGLISH) {
-
 
115
                        $language = 'LABEL_ENGLISH';
-
 
116
                    } else {
-
 
117
                        $language = '';
-
 
118
                    }
-
 
119
 
-
 
120
                    $item = [
-
 
121
                        'id' => $record->id,
-
 
122
                        'name' => $record->name,
-
 
123
                        'language' => $language,
107
                $select = $queryMapper->getSql()->select();
124
                        'status' => $record->status,
108
                $select->columns(['uuid', 'content','status','user_id','company_id']);
125
                        'actions' => [
-
 
126
                            'link_edit' => $this->url()->fromRoute('self-evaluation/forms/edit', ['id' => $record->uuid]),
-
 
Línea 127... Línea 109...
127
                            'link_delete' => $this->url()->fromRoute('self-evaluation/forms/delete', ['id' => $record->uuid])
109
                $select->from(['test' => CompanySelfEvaluationTestMapper::_TABLE]);
-
 
110
                $select->join(['form' => CompanySelfEvaluationFormMapper::_TABLE], 'test.form_id = form.id', []);
128
                        ]
111
                $select->where->equalTo('f.status', CompanySelfEvaluationForm::STATUS_ACTIVE);
-
 
112
 
-
 
113
                if ($search) {
-
 
114
                    $select->where->NEST->like('name', '%' . $search . '%');
-
 
115
                }
-
 
116
                $select->order('name ASC, language ASC');
-
 
117
 
Línea 129... Línea 118...
129
                    ];
118
                $records = $queryMapper->fetchAll($select);
130
 
119
                $items = [];
131
                    array_push($items, $item);
120
                
132
                }
121
                array_push($items, $item);
133
 
122
 
134
                return new JsonModel([
123
                return new JsonModel([
135
                    'success' => true,
124
                    'success' => true,
136
                    'data' => [
125
                    'data' => [