Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17020 Rev 17288
Línea 59... Línea 59...
59
    /**
59
    /**
60
     *
60
     *
61
     * @var \Laminas\Db\Adapter\AdapterInterface
61
     * @var \Laminas\Db\Adapter\AdapterInterface
62
     */
62
     */
63
    private $adapter;
63
    private $adapter;
64
    
64
 
65
    /**
65
    /**
66
     *
66
     *
67
     * @var \LeadersLinked\Cache\CacheInterface
67
     * @var \LeadersLinked\Cache\CacheInterface
68
     */
68
     */
69
    private $cache;
69
    private $cache;
70
    
70
 
71
    
71
 
72
    /**
72
    /**
73
     *
73
     *
74
     * @var \Laminas\Log\LoggerInterface
74
     * @var \Laminas\Log\LoggerInterface
75
     */
75
     */
76
    private $logger;
76
    private $logger;
77
    
77
 
78
    /**
78
    /**
79
     *
79
     *
80
     * @var array
80
     * @var array
81
     */
81
     */
82
    private $config;
82
    private $config;
83
    
83
 
84
    
84
 
85
    /**
85
    /**
86
     *
86
     *
87
     * @var \Laminas\Mvc\I18n\Translator
87
     * @var \Laminas\Mvc\I18n\Translator
88
     */
88
     */
89
    private $translator;
89
    private $translator;
90
    
90
 
91
    
91
 
92
    /**
92
    /**
93
     *
93
     *
94
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
94
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
95
     * @param \LeadersLinked\Cache\CacheInterface $cache
95
     * @param \LeadersLinked\Cache\CacheInterface $cache
96
     * @param \Laminas\Log\LoggerInterface LoggerInterface $logger
96
     * @param \Laminas\Log\LoggerInterface LoggerInterface $logger
Línea 215... Línea 215...
215
 
215
 
216
                        case Job::EMPLOYMENT_TYPE_TEMPORARY:
216
                        case Job::EMPLOYMENT_TYPE_TEMPORARY:
217
                            $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
217
                            $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
Línea -... Línea 218...
-
 
218
                            break;
-
 
219
 
-
 
220
                        case Job::EMPLOYMENT_TYPE_FREELANCE:
-
 
221
                            $employment_type = 'LABEL_EMPLOYMENT_TYPE_FREELANCE';
-
 
222
                            break;
218
                            break;
223
 
219
 
224
 
220
                        default:
225
                        default:
221
                            $employment_type = '';
226
                            $employment_type = '';
Línea 401... Línea 406...
401
 
406
 
402
                            case Job::EMPLOYMENT_TYPE_TEMPORARY:
407
                            case Job::EMPLOYMENT_TYPE_TEMPORARY:
403
                                $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
408
                                $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
Línea -... Línea 409...
-
 
409
                                break;
-
 
410
 
-
 
411
                            case Job::EMPLOYMENT_TYPE_FREELANCE:
-
 
412
                                $employment_type = 'LABEL_EMPLOYMENT_TYPE_FREELANCE';
404
                                break;
413
                                break;
405
 
414
 
406
                            default:
415
                            default:
407
                                $employment_type = '';
416
                                $employment_type = '';
Línea 654... Línea 663...
654
 
663
 
655
                case Job::EMPLOYMENT_TYPE_TEMPORARY:
664
                case Job::EMPLOYMENT_TYPE_TEMPORARY:
656
                    $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
665
                    $employment_type = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
Línea -... Línea 666...
-
 
666
                    break;
-
 
667
 
-
 
668
                case Job::EMPLOYMENT_TYPE_FREELANCE:
-
 
669
                    $employment_type = 'LABEL_EMPLOYMENT_TYPE_FREELANCE';
657
                    break;
670
                    break;
658
 
671
 
659
                default:
672
                default:
660
                    $employment_type = '';
673
                    $employment_type = '';
Línea 812... Línea 825...
812
            return new JsonModel($response);
825
            return new JsonModel($response);
813
        }
826
        }
Línea 814... Línea 827...
814
 
827
 
815
 
828
 
816
 
829
 
817
        if($job->description) {
830
        if ($job->description) {
818
            $description = strip_tags(trim($job->description), ['p']);
831
            $description = strip_tags(trim($job->description), ['p']);
Línea 1038... Línea 1051...
1038
        $employment_types = [];
1051
        $employment_types = [];
1039
        $employment_types[Job::EMPLOYMENT_TYPE_FULL_TIME] = 'LABEL_EMPLOYMENT_TYPE_FULL_TIME';
1052
        $employment_types[Job::EMPLOYMENT_TYPE_FULL_TIME] = 'LABEL_EMPLOYMENT_TYPE_FULL_TIME';
1040
        $employment_types[Job::EMPLOYMENT_TYPE_PART_TIME] = 'LABEL_EMPLOYMENT_TYPE_PART_TIME';
1053
        $employment_types[Job::EMPLOYMENT_TYPE_PART_TIME] = 'LABEL_EMPLOYMENT_TYPE_PART_TIME';
1041
        $employment_types[Job::EMPLOYMENT_TYPE_CONTRACT] = 'LABEL_EMPLOYMENT_TYPE_CONTRACT';
1054
        $employment_types[Job::EMPLOYMENT_TYPE_CONTRACT] = 'LABEL_EMPLOYMENT_TYPE_CONTRACT';
1042
        $employment_types[Job::EMPLOYMENT_TYPE_TEMPORARY] = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
1055
        $employment_types[Job::EMPLOYMENT_TYPE_TEMPORARY] = 'LABEL_EMPLOYMENT_TYPE_TEMPORARY';
-
 
1056
        $employment_types[Job::EMPLOYMENT_TYPE_FREELANCE] = 'LABEL_EMPLOYMENT_TYPE_FREELANCE';
Línea 1043... Línea 1057...
1043
 
1057
 
1044
 
1058
 
1045
        $request = $this->getRequest();
1059
        $request = $this->getRequest();
Línea 1310... Línea 1324...
1310
            ];
1324
            ];
Línea 1311... Línea 1325...
1311
 
1325
 
1312
            return new JsonModel($response);
1326
            return new JsonModel($response);
Línea 1313... Línea 1327...
1313
        }
1327
        }
1314
 
1328
 
1315
        
1329
 
1316
        $currencies = [];
1330
        $currencies = [];
1317
        $currencyMapper = CurrencyMapper::getInstance($this->adapter);
1331
        $currencyMapper = CurrencyMapper::getInstance($this->adapter);
1318
        $records =  $currencyMapper->fetchAllActive();
-
 
1319
        foreach($records as $record)
1332
        $records =  $currencyMapper->fetchAllActive();
1320
        {
1333
        foreach ($records as $record) {
1321
            $currencies[$record->currency] = $record->name;
1334
            $currencies[$record->currency] = $record->name;
1322
        }
1335
        }
1323
        
1336
 
1324
        
1337
 
Línea 1325... Línea 1338...
1325
        
1338
 
1326
        
1339
 
1327
 
1340
 
1328
        $request = $this->getRequest();
1341
        $request = $this->getRequest();
1329
        if ($request->isGet()) {
1342
        if ($request->isGet()) {
1330
            $data = [
1343
            $data = [
1331
                'success' => true,
1344
                'success' => true,
1332
                'data' => [
1345
                'data' => [
1333
                    'salary_visible' => $job->salary_visible,
1346
                    'salary_visible' => $job->salary_visible,
1334
                    'salary_currency' => $job->salary_currency,
1347
                    'salary_currency' => $job->salary_currency,
1335
                    'salary_min' => $job->salary_min,
1348
                    'salary_min' => $job->salary_min,
1336
                    'salary_max' =>  $job->salary_max, 
1349
                    'salary_max' =>  $job->salary_max,
Línea 1337... Línea 1350...
1337
                    'currencies' => $currencies,
1350
                    'currencies' => $currencies,
Línea 2081... Línea 2094...
2081
    public function usersWhoAppliedAction()
2094
    public function usersWhoAppliedAction()
2082
    {
2095
    {
2083
        $currentUserPlugin = $this->plugin('currentUserPlugin');
2096
        $currentUserPlugin = $this->plugin('currentUserPlugin');
2084
        $currentUser = $currentUserPlugin->getUser();
2097
        $currentUser = $currentUserPlugin->getUser();
2085
        $currentCompany = $currentUserPlugin->getCompany();
2098
        $currentCompany = $currentUserPlugin->getCompany();
2086
        
2099
 
2087
        $currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
2100
        $currentNetworkPlugin = $this->plugin('currentNetworkPlugin');
2088
        $network = $currentNetworkPlugin->getNetwork();
2101
        $network = $currentNetworkPlugin->getNetwork();
Línea 2089... Línea 2102...
2089
 
2102
 
Línea 2132... Línea 2145...
2132
            $select->join(['ja' => JobApplicationMapper::_TABLE], 'ja.user_id = u.id', ['user_profile_id']);
2145
            $select->join(['ja' => JobApplicationMapper::_TABLE], 'ja.user_id = u.id', ['user_profile_id']);
2133
            $select->join(['up' => UserProfileMapper::_TABLE], 'ja.user_profile_id = up.id', ['user_profile_uuid' => 'uuid']);
2146
            $select->join(['up' => UserProfileMapper::_TABLE], 'ja.user_profile_id = up.id', ['user_profile_uuid' => 'uuid']);
2134
            $select->where->equalTo('u.status', User::STATUS_ACTIVE);
2147
            $select->where->equalTo('u.status', User::STATUS_ACTIVE);
2135
            $select->where->equalTo('ja.job_id', $job->id);
2148
            $select->where->equalTo('ja.job_id', $job->id);
2136
            $select->order(['first_name', 'last_name']);
2149
            $select->order(['first_name', 'last_name']);
2137
            
2150
 
2138
            
2151
 
Línea 2139... Línea 2152...
2139
 
2152
 
2140
            $items = [];
2153
            $items = [];
Línea 2141... Línea 2154...
2141
            $records = $queryMapper->fetchAll($select);
2154
            $records = $queryMapper->fetchAll($select);
2142
 
2155
 
2143
            foreach ($records as $record) {
2156
            foreach ($records as $record) {
2144
                $item = [
2157
                $item = [
2145
                    'first_name' => $record['first_name'],
2158
                    'first_name' => $record['first_name'],
2146
                    'last_name' => $record['last_name'],
2159
                    'last_name' => $record['last_name'],
Línea 2147... Línea 2160...
2147
                    'email' => $record['email'],
2160
                    'email' => $record['email'],
Línea 2148... Línea 2161...
2148
                    'link_view' => 'https://'. $network->main_hostname . '/profile/view/' . $record['user_profile_uuid'],
2161
                    'link_view' => 'https://' . $network->main_hostname . '/profile/view/' . $record['user_profile_uuid'],
2149
 
2162