Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 6676 Rev 6681
Línea 773... Línea 773...
773
               
773
               
774
                $surveyFormMapper = SurveyFormMapper::getInstance($this->adapter);
774
                $surveyFormMapper = SurveyFormMapper::getInstance($this->adapter);
775
                $surveyForm = $surveyFormMapper->fetchOneByUuid($dataPost['form_id']);
775
                $surveyForm = $surveyFormMapper->fetchOneByUuid($dataPost['form_id']);
Línea 776... Línea 776...
776
                $survey->form_id = $surveyForm->id;
776
                $survey->form_id = $surveyForm->id;
-
 
777
               
-
 
778
                if($surveyMapper->update($survey)){
-
 
779
                    $survey = $surveyMapper->fetchOne($survey->id);
-
 
780
 
-
 
781
                    $jobDescription = new SurveyJobDescription();
-
 
782
                    $skill = new SurveySkill();
-
 
783
                    $industry = new SurveyIndustry();
-
 
784
                    $language = new SurveyLanguage();
-
 
785
 
-
 
786
                    if(!empty($dataPost['location_search'])){ 
-
 
787
 
-
 
788
                        $surveyLocationMapper = SurveyLocationMapper::getInstance($this->adapter);
-
 
789
    
-
 
790
                        $ok = true;
-
 
791
 
-
 
792
                        $formatted_address = $dataPost['formatted_address'];
-
 
793
                        $city1 = $dataPost['city1'];
-
 
794
                        $city2 = $dataPost['city2'];
-
 
795
                        $address1 = $dataPost['address1'];
-
 
796
                        $address2 = $dataPost['address2'];
-
 
797
                        $country = $dataPost['country'];
-
 
798
                        $latitude = $dataPost['latitude'];
-
 
799
                        $longitude = $dataPost['longitude'];
-
 
800
                        $postal_code = $dataPost['postal_code'];
-
 
801
                        $state = $dataPost['state'];
-
 
802
 
-
 
803
                        
-
 
804
                        $record = new SurveyLocation();
-
 
805
                        $record->formatted_address = $formatted_address; 
-
 
806
                        $record->city1 = $city1;
-
 
807
                        $record->city2 = $city2;
-
 
808
                        $record->address1 = $address1;
-
 
809
                        $record->address2 = $address2;
-
 
810
                        $record->country = $country;
-
 
811
                        $record->latitude = $latitude;
-
 
812
                        $record->longitude = $longitude;
-
 
813
                        $record->postal_code = $postal_code;
-
 
814
                        $record->state = $state;
-
 
815
                        $record->survey_id = $survey->id;
-
 
816
                        $result = $surveyLocationMapper->update($record);
-
 
817
                        $ok = $ok && $result;
-
 
818
                           //}
-
 
819
                          if($ok){
-
 
820
    
-
 
821
                        }
-
 
822
                    }
-
 
823
 
-
 
824
                    if(!empty($dataPost['job_description_id'])){ 
-
 
825
 
-
 
826
                       // print_r($dataPost['job_description_id']);
-
 
827
 
-
 
828
                        $jobDescriptionMapper = JobDescriptionMapper::getInstance($this->adapter);
-
 
829
                        $surveyJobDescriptionMapper = SurveyJobDescriptionMapper::getInstance($this->adapter);
-
 
830
 
-
 
831
                        $ok = true;
-
 
832
 
-
 
833
                        foreach($dataPost['job_description_id'] as $jobDescriptionUuid) {
-
 
834
                        
-
 
835
                           // echo '$jobDescriptionUuid = ' . $jobDescriptionUuid ; 
-
 
836
 
-
 
837
 
-
 
838
                            $jobDescription = $jobDescriptionMapper->fetchOneByUuid($jobDescriptionUuid);
-
 
839
 
-
 
840
                           // print_r($jobDescription);
-
 
841
                            //print_r($currentCompany);
-
 
842
 
-
 
843
                            if($jobDescription && $jobDescription->company_id == $currentCompany->id) {
-
 
844
                                $record = new SurveyJobDescription();
-
 
845
                                $record->job_description_id = $jobDescription->id;
-
 
846
                                $record->survey_id = $survey->id;
-
 
847
 
-
 
848
                            
-
 
849
 
-
 
850
                                $result = $surveyJobDescriptionMapper->update($record);
-
 
851
                                $ok = $ok && $result;
-
 
852
                            }
-
 
853
                        }
-
 
854
                    
-
 
855
                        if($ok){
-
 
856
 
-
 
857
                        }
-
 
858
                    }
-
 
859
 
-
 
860
                    $data = [
-
 
861
                        'success' => true,
-
 
862
                        'data' => 'LABEL_RECORD_ADDED'
-
 
863
                    ];
-
 
864
                    //      return new JsonModel($data); 
-
 
865
 
-
 
866
                    if(!empty($dataPost['skill_id'])){ 
-
 
867
 
-
 
868
                        // print_r($dataPost['skill_id']);
-
 
869
 
-
 
870
                         $skillMapper = SkillMapper::getInstance($this->adapter);
-
 
871
                         $surveySkillMapper = SurveySkillMapper::getInstance($this->adapter);
-
 
872
 
-
 
873
                         $ok = true;
-
 
874
 
-
 
875
                         foreach($dataPost['skill_id'] as $skillUuid) {
-
 
876
 
-
 
877
                            // echo '$jobCategoryUuid = ' . $jobCategoryUuid ; 
-
 
878
 
-
 
879
 
-
 
880
                             $skill = $skillMapper->fetchOneByUuid($skillUuid);
-
 
881
 
-
 
882
                            // print_r($skill);
-
 
883
                            //print_r($currentCompany);
-
 
884
 
-
 
885
                            //if($skill && $skill->company_id == $currentCompany->id) {
-
 
886
                                $record = new SurveySkill();
-
 
887
                                $record->skill_id = $skill->id;
-
 
888
                                $record->survey_id = $survey->id;
-
 
889
 
-
 
890
 
-
 
891
                                $result = $surveySkillMapper->update($record);
-
 
892
                                $ok = $ok && $result;
-
 
893
                            // }
-
 
894
                         }
-
 
895
                     
-
 
896
                         if($ok){
-
 
897
 
-
 
898
                         }
-
 
899
                     }
-
 
900
 
-
 
901
                    $data = [
-
 
902
                        'success' => true,
-
 
903
                        'data' => 'test'
-
 
904
                    ];
-
 
905
                    //      return new JsonModel($data); exit;
-
 
906
 
-
 
907
                    if(!empty($dataPost['industry_id'])){ 
-
 
908
 
-
 
909
                        // print_r($dataPost['industry_id']);
-
 
910
 
-
 
911
                         $industryMapper = IndustryMapper::getInstance($this->adapter);
-
 
912
                         $surveyIndustryMapper = SurveyIndustryMapper::getInstance($this->adapter);
-
 
913
 
-
 
914
                         $ok = true;
-
 
915
 
-
 
916
                         foreach($dataPost['industry_id'] as $industryUuid) {
-
 
917
 
-
 
918
                            // echo '$industryUuid = ' . $industryUuid ; 
-
 
919
 
-
 
920
 
-
 
921
                             $industry = $industryMapper->fetchOneByUuid($industryUuid);
-
 
922
 
-
 
923
                            // print_r($industry);
-
 
924
                             //print_r($currentCompany);
-
 
925
 
-
 
926
                             //if($industry && $industry->company_id == $currentCompany->id) {
-
 
927
                                 $record = new SurveyIndustry();
-
 
928
                                 $record->industry_id = $industry->id;
-
 
929
                                 $record->survey_id = $survey->id;
-
 
930
 
-
 
931
                            
-
 
932
 
-
 
933
                                 $result = $surveyIndustryMapper->update($record);
-
 
934
                                 $ok = $ok && $result;
-
 
935
                             //}
-
 
936
                         }
-
 
937
                     
-
 
938
                         if($ok){
-
 
939
 
-
 
940
                         }
-
 
941
                     }
-
 
942
 
-
 
943
                    $data = [
-
 
944
                        'success' => true,
-
 
945
                        'data' => 'test industry'
-
 
946
                    ];
-
 
947
                    // return new JsonModel($data); exit;
-
 
948
                
-
 
949
                    if(!empty($dataPost['language_id'])){ 
-
 
950
 
-
 
951
                        $surveyLanguageMapper = SurveyLanguageMapper::getInstance($this->adapter);
-
 
952
 
-
 
953
                        $ok = true;
-
 
954
 
-
 
955
                        foreach($dataPost['language_id'] as $language_id) {
-
 
956
 
-
 
957
                                $record = new SurveyLanguage();
-
 
958
                                $record->language_id = $language_id;
-
 
959
                                $record->survey_id = $survey->id;
-
 
960
 
-
 
961
 
-
 
962
                                $result = $surveyLanguageMapper->update($record);
-
 
963
                                $ok = $ok && $result;
-
 
964
                           //}
-
 
965
                        }
-
 
966
                          if($ok){
-
 
967
 
-
 
968
                        }
-
 
969
                     }
-
 
970
                }
-
 
971
 
Línea 777... Línea 972...
777
               
972
            return new JsonModel($data);
778
                $result = $surveyMapper->update($survey);
973
               
779
 
974
 
780
                if ($result) {
975
                if ($result) {