Esempio n. 1
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'Docgroupcomptable.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
         $builder->add('parent', EntityType::class, array('label' => 'Docgroupcomptable.parent.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) {
             return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
         }, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
         $builder->add('clone', EntityType::class, array('label' => 'Docgroup.clone.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) {
             return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
         }, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'mapped' => false));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'Docgroupcomptable.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
         $builder->add('parent', EntityType::class, array('label' => 'Docgroupcomptable.parent.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) use($companyId) {
             return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
         }, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
         $builder->add('clone', EntityType::class, array('label' => 'Docgroup.clone.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) use($companyId) {
             return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
         }, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'mapped' => false));
     }
     $builder->add('label', TextType::class, array('label' => 'Docgroupcomptable.label.label'));
     $builder->add('otherInfos', TextareaType::class, array('label' => 'Docgroupcomptable.otherInfos.label', 'required' => false));
 }
Esempio n. 2
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'Address.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'Address.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('label', TextType::class, array('label' => 'Address.label.label'));
     $builder->add('streetNum', IntegerType::class, array('label' => 'Address.streetNum.label', 'scale' => 0, 'required' => false));
     $builder->add('address', TextareaType::class, array('label' => 'Address.address.label', 'required' => false));
     $builder->add('address2', TextareaType::class, array('label' => 'Address.address2.label', 'required' => false));
     $builder->add('town', TextType::class, array('label' => 'Address.town.label', 'required' => false));
     $builder->add('zipCode', TextType::class, array('label' => 'Address.zipCode.label', 'required' => false));
     $builder->add('country', CountryType::class, array('label' => 'Address.country.label', 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
     $builder->add('email', EmailType::class, array('label' => 'Address.email.label', 'required' => false));
     $builder->add('phone', TextType::class, array('label' => 'Address.phone.label', 'required' => false));
     $builder->add('mobile', TextType::class, array('label' => 'Address.mobile.label', 'required' => false));
     $builder->add('fax', TextType::class, array('label' => 'Address.fax.label', 'required' => false));
     $builder->add('otherInfos', TextareaType::class, array('label' => 'Address.otherInfos.label', 'required' => false));
 }
Esempio n. 3
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'Supplier.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'Supplier.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('label', TextType::class, array('label' => 'Supplier.label.label'));
     $builder->add('number', IntegerType::class, array('label' => 'Supplier.number.label'));
     $builder->add('fisc', TextType::class, array('label' => 'Supplier.fisc.label', 'required' => false));
     $builder->add('physicaltype', ChoiceType::class, array('label' => 'Supplier.physicaltype.label', 'choices_as_values' => true, 'choices' => Supplier::choicePhysicaltype(), 'expanded' => true, 'attr' => array('choice_label_trans' => true)));
     $builder->add('cin', TextType::class, array('label' => 'Supplier.cin.label', 'required' => false));
     $builder->add('passport', TextType::class, array('label' => 'Supplier.passport.label', 'required' => false));
     $builder->add('commercialRegister', TextType::class, array('label' => 'Supplier.commercialRegister.label', 'required' => false));
     $builder->add('email', EmailType::class, array('label' => 'Supplier.email.label', 'required' => false));
     $builder->add('phone', TextType::class, array('label' => 'Supplier.phone.label', 'required' => false));
     $builder->add('mobile', TextType::class, array('label' => 'Supplier.mobile.label', 'required' => false));
     $builder->add('fax', TextType::class, array('label' => 'Supplier.fax.label', 'required' => false));
     $builder->add('streetNum', IntegerType::class, array('label' => 'Supplier.streetNum.label', 'scale' => 0, 'required' => false));
     $builder->add('address', TextareaType::class, array('label' => 'Supplier.address.label', 'required' => false));
     $builder->add('address2', TextareaType::class, array('label' => 'Supplier.address2.label', 'required' => false));
     $builder->add('town', TextType::class, array('label' => 'Supplier.town.label', 'required' => false));
     $builder->add('zipCode', TextType::class, array('label' => 'Supplier.zipCode.label', 'required' => false));
     $builder->add('country', CountryType::class, array('label' => 'Supplier.country.label', 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
     $builder->add('otherInfos', TextareaType::class, array('label' => 'Supplier.otherInfos.label', 'required' => false));
 }
Esempio n. 4
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('year', IntegerType::class, array('label' => 'MBSale.year.label'));
 }
 public function updateCompany(Company $company)
 {
     $result = $this->companyDao->get($company->getId());
     ResultHelper::whenEmpty($result, AppLabelUtil::$ERROR_COMPANY_NOT_FOUND, HttpStatusCode::badRequest());
     $company->setStatus($this->validateStatus($company->getStatus()));
     $this->companyDao->update($company);
 }
Esempio n. 6
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'Pilot.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'Pilot.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('ref', TextType::class, array('label' => 'Pilot.ref.label', 'required' => false));
     $builder->add('mission', TextType::class, array('label' => 'Pilot.mission.label', 'required' => false));
     $builder->add('natureMission', TextType::class, array('label' => 'Pilot.natureMission.label', 'required' => false));
     $builder->add('prestataire', TextType::class, array('label' => 'Pilot.prestataire.label', 'required' => false));
     $builder->add('recetteFinance', TextType::class, array('label' => 'Pilot.recetteFinance.label', 'required' => false));
     $builder->add('pinAnce', TextType::class, array('label' => 'Pilot.pinAnce.label', 'required' => false));
     $builder->add('expirationAnce', TextType::class, array('label' => 'Pilot.expirationAnce.label', 'required' => false));
     $builder->add('mpImpots', TextType::class, array('label' => 'Pilot.mpImpots.label', 'required' => false));
     $builder->add('idCnss', TextType::class, array('label' => 'Pilot.idCnss.label', 'required' => false));
     $builder->add('mpCnss', TextType::class, array('label' => 'Pilot.mpCnss.label', 'required' => false));
     $builder->add('nomCac', TextType::class, array('label' => 'Pilot.nomCac.label', 'required' => false));
     $builder->add('dureeMandat', TextType::class, array('label' => 'Pilot.dureeMandat.label', 'required' => false));
     $builder->add('numMandat', TextType::class, array('label' => 'Pilot.numMandat.label', 'required' => false));
     $builder->add('rapportCac', TextType::class, array('label' => 'Pilot.rapportCac.label', 'required' => false));
     $builder->add('declEmpl', TextType::class, array('label' => 'Pilot.declEmpl.label', 'required' => false));
     $builder->add('isDur', TextType::class, array('label' => 'Pilot.isDur.label', 'required' => false));
     $builder->add('pvCa', TextType::class, array('label' => 'Pilot.pvCa.label', 'required' => false));
     $builder->add('rapportGerance', TextType::class, array('label' => 'Pilot.rapportGerance.label', 'required' => false));
     $builder->add('pvAgo', TextType::class, array('label' => 'Pilot.pvAgo.label', 'required' => false));
     $builder->add('pvAge', TextType::class, array('label' => 'Pilot.pvAge.label', 'required' => false));
     $builder->add('livresCotes', TextType::class, array('label' => 'Pilot.livresCotes.label', 'required' => false));
     $builder->add('honTeorAnn', NumberType::class, array('label' => 'Pilot.honTeorAnn.label', 'required' => false));
     $builder->add('modeFact', TextType::class, array('label' => 'Pilot.modeFact.label', 'required' => false));
     $builder->add('nonFactMont', NumberType::class, array('label' => 'Pilot.nonFactMont.label', 'required' => false));
     $builder->add('nonFactDesc', TextType::class, array('label' => 'Pilot.nonFactDesc.label', 'required' => false));
     $builder->add('nonEncMont', NumberType::class, array('label' => 'Pilot.nonEncMont.label', 'required' => false));
     $builder->add('nonEncDesc', TextType::class, array('label' => 'Pilot.nonEncDesc.label', 'required' => false));
     $builder->add('commentQuit', TextType::class, array('label' => 'Pilot.commentQuit.label', 'required' => false));
     $builder->add('mqQuitImpots', TextType::class, array('label' => 'Pilot.mqQuitImpots.label', 'required' => false));
     $builder->add('mqQuitCnss', TextType::class, array('label' => 'Pilot.mqQuitCnss.label', 'required' => false));
     $builder->add('comments', TextType::class, array('label' => 'Pilot.comments.label', 'required' => false));
 }
 protected function getTableName()
 {
     return Company::getId() . '_ProjectMessages';
     /*$campaign = Company::search_by_domain($_SERVER['SERVER_NAME']);
     		if ($campaign->id) {
     			return '`'.$campaign->id.'_ProjectMessages`';
     		} else {
     			return "`ProjectMessages`";
     		}*/
 }
Esempio n. 8
0
 public function filterLogin($filterChain)
 {
     $id = Company::getId();
     if (empty($id)) {
         throw new RuntimeException('非法访问');
     }
     $this->comId = $id;
     $this->comName = Company::getName();
     return $filterChain->run();
 }
Esempio n. 9
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     $this->job = $options['job'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     if (null == $this->job) {
         $builder->add('job', EntityType::class, array('label' => 'CompanyFrame.job.label', 'class' => 'AcfDataBundle:Job', 'query_builder' => function (JobRepository $br) {
             return $br->createQueryBuilder('j')->orderBy('j.label', 'ASC');
         }, 'choice_label' => 'label', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $jobId = $this->job->getId();
         $builder->add('job', EntityidType::class, array('label' => 'CompanyFrame.job.label', 'class' => 'AcfDataBundle:Job', 'query_builder' => function (JobRepository $br) use($jobId) {
             return $br->createQueryBuilder('j')->where('j.id = :id')->setParameter('id', $jobId)->orderBy('j.label', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('sexe', ChoiceType::class, array('label' => 'CompanyFrame.sexe.label', 'choices_as_values' => true, 'choices' => CompanyFrame::choiceSexe(), 'attr' => array('choice_label_trans' => true)));
     $builder->add('firstName', TextType::class, array('label' => 'CompanyFrame.firstName.label'));
     $builder->add('lastName', TextType::class, array('label' => 'CompanyFrame.lastName.label'));
     $builder->add('cin', TextType::class, array('label' => 'CompanyFrame.cin.label', 'required' => false));
     $builder->add('passport', TextType::class, array('label' => 'CompanyFrame.passport.label', 'required' => false));
     $builder->add('email', EmailType::class, array('label' => 'CompanyFrame.email.label', 'required' => false));
     $builder->add('phone', TextType::class, array('label' => 'CompanyFrame.phone.label', 'required' => false));
     $builder->add('mobile', TextType::class, array('label' => 'CompanyFrame.mobile.label', 'required' => false));
     $builder->add('streetNum', IntegerType::class, array('label' => 'CompanyFrame.streetNum.label', 'scale' => 0, 'required' => false));
     $builder->add('address', TextareaType::class, array('label' => 'CompanyFrame.address.label', 'required' => false));
     $builder->add('address2', TextareaType::class, array('label' => 'CompanyFrame.address2.label', 'required' => false));
     $builder->add('town', TextType::class, array('label' => 'CompanyFrame.town.label', 'required' => false));
     $builder->add('zipCode', TextType::class, array('label' => 'CompanyFrame.zipCode.label', 'required' => false));
     $builder->add('country', CountryType::class, array('label' => 'CompanyFrame.country.label', 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
     $builder->add('otherInfos', TextareaType::class, array('label' => 'CompanyFrame.otherInfos.label', 'required' => false));
 }
Esempio n. 10
0
 public function mapCompanyToDto(Company $company)
 {
     $companyDto = new CompanyDto();
     $companyDto->setId($company->getId());
     $companyDto->setName($company->getName());
     $companyDto->setContactName($company->getContactName());
     $companyDto->setEmail($company->getEmail());
     $companyDto->setPhoneNumber($company->getPhoneNumber());
     $companyDto->setRegion($company->getRegion());
     $companyDto->setWebsite($company->getWebsite());
     $companyDto->setStatus($company->getStatus());
     return $companyDto;
 }
Esempio n. 11
0
 /**
  * Form builder
  *
  * @param FormBuilderInterface $builder
  * @param array $options
  *
  * @return null
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $this->company = $options['company'];
     if (null == $this->company) {
         $builder->add('company', EntityType::class, array('label' => 'Bank.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
             return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
     } else {
         $companyId = $this->company->getId();
         $builder->add('company', EntityidType::class, array('label' => 'Bank.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
             return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
         }, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
     }
     $builder->add('label', TextType::class, array('label' => 'Bank.label.label'));
     $builder->add('number', IntegerType::class, array('label' => 'Bank.number.label'));
     $builder->add('agency', TextType::class, array('label' => 'Bank.agency.label'));
     $builder->add('rib', TextType::class, array('label' => 'Bank.rib.label'));
     $builder->add('contact', TextType::class, array('label' => 'Bank.contact.label', 'required' => false));
     $builder->add('tel', TextType::class, array('label' => 'Bank.tel.label', 'required' => false));
     $builder->add('fax', TextType::class, array('label' => 'Bank.fax.label', 'required' => false));
     $builder->add('email', EmailType::class, array('label' => 'Bank.email.label', 'required' => false));
     $builder->add('otherInfos', TextareaType::class, array('label' => 'Bank.otherInfos.label', 'required' => false));
 }
 public function actionUpload()
 {
     if ($_GET['id']) {
         $id = intval($_GET['id']);
     }
     if ($_GET['unixtime']) {
         $unixtime = intval($_GET['unixtime']);
     }
     $folder = Yii::getPathOfAlias('webroot') . '/uploads/c' . Company::getId();
     if ($id) {
         $folder .= '/' . $id . '/';
     } else {
         $folder .= '/temp/' . $unixtime . '/';
     }
     $result = Tools::uploadMaterials($folder);
     echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
     if ($id && $result['success'] && User::model()->isCustomer()) {
         EventHelper::materialsAdded($id);
     }
 }
Esempio n. 13
0
 /**
  * Declares an association between this object and a Company object.
  *
  * @param      Company $v
  * @return     Element The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setCompany(Company $v = null)
 {
     if ($v === null) {
         $this->setCompanyId(NULL);
     } else {
         $this->setCompanyId($v->getId());
     }
     $this->aCompany = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Company object, it will not be re-added.
     if ($v !== null) {
         $v->addElement($this);
     }
     return $this;
 }
Esempio n. 14
0
 public function tableName()
 {
     return Company::getId() . '_' . 'Profiles';
     //Yii::app()->getModule('user')->tableProfiles;
 }
Esempio n. 15
0
 /**
  * Check if this user is manager of a given company
  *
  * If $company is missing user will be checked agains his own company
  *
  * @param Company $company
  * @return boolean
  */
 function isCompanyManager($company)
 {
     if ($this->isAdministrator() || $this->isPeopleManager()) {
         return true;
     }
     // if
     return $this->getCompanyId() == $company->getId() && $this->getSystemPermission('manage_company_details');
 }
Esempio n. 16
0
<?php 
/* @var $this ZakazController */
/* @var $model Zakaz */
$this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), ProjectModule::t('List'));
?>
<h1><?php 
echo ProjectModule::t('Zakazs');
?>
</h1>
<h1 class='projects-title'><?php 
echo ProjectModule::t('SelectProject');
?>
</h1>
<?php 
if (Company::getId()) {
    $columns = array('id', 'title');
    if (ProjectField::model()->inTableByVarname('specials')) {
        $columns[] = array('name' => 'specials', 'filter' => Catalog::getAll('specials'), 'value' => '$data->catalog_specials->cat_name');
    }
    if (ProjectField::model()->inTableByVarname('specials2')) {
        $columns[] = array('name' => 'specials2', 'filter' => Catalog::getAll('specials2'), 'value' => '$data->catalog_specials2->cat_name');
    }
    $columns[] = 'closestDate';
    if (!isset($only_new)) {
        $columns[] = ['name' => 'executor_event', 'value' => '$data->getExecutorEvents()', 'type' => 'raw'];
    }
}
if (User::model()->isCorrector() && $tech) {
    $url = Yii::app()->createUrl('/project/chat', array('role' => 'Corrector', 'orderId' => ''));
} elseif (isset($only_new)) {
Esempio n. 17
0
 /**
 * Check if this user is company administration (used to check many other permissions). User must
 * be part of the company and have is_admin stamp set to true
 *
 * @access public
 * @param Company $company
 * @return boolean
 */
 function isCompanyAdmin(Company $company) {
   return ($this->getCompanyId() == $company->getId()) && $this->getIsAdmin();
 } // isCompanyAdmin
 /**
  * @return string the associated database table name
  */
 public function tableName()
 {
     return Company::getId() . '_AuthAssignment';
     //return 'AuthAssignment';
 }
Esempio n. 19
0
    $payFieldsUser = $data->profileUser;
    foreach ($payFields as $field) {
        $fields[] = $field->varname;
        $final[$field->varname] = $field->title;
    }
    $fields = implode($fields, ',');
    $userPayFields = Profile::model()->find(array('select' => $fields, 'condition' => 'user_id = :user', 'params' => array(':user' => $data->profileUser->id)));
    $fields = array();
    if (!empty($userPayFields)) {
        foreach ($userPayFields as $key => $field) {
            if ($field != null) {
                $fields[$key] = $final[$key];
            }
        }
    }
    $model = Company::model()->findByPk(Company::getId());
    if ($model !== null && $model->PaymentCash == '1') {
        $fields['cash'] = 'Наличные';
    }
    return CHtml::dropDownList('paymentType_' . $data->id, $data->details_type, $fields, array('empty' => '', 'disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false, 'ajax' => array('url' => PaymentController::createUrl('getPayNumber'), 'data' => array('payType' => 'js:this.value', 'user' => $data->profileUser->id), 'success' => 'function(html) {
									if (html != "") $("#payDetailNumber_' . $data->id . '").val(html);
									else $("#payDetailNumber_' . $data->id . '").val("");
								}')));
}), array('name' => 'details_number', 'type' => 'raw', 'value' => function ($data) {
    return CHtml::textField("payDetailNumber_{$data->id}", $data->details_number, array('disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false));
}), array('name' => 'approve', 'type' => 'raw', 'value' => function ($data) {
    return approve_buttons($data);
}, 'filter' => array('0' => Yii::t('site', 'New'), '1' => Yii::t('site', 'Confirmed'), '2' => Yii::t('site', 'Rejected'))), array('header' => 'Отменить платеж', 'class' => 'CButtonColumn', 'template' => '{cancel}', 'buttons' => array('cancel' => array('label' => Yii::t('site', 'Cancel'), 'options' => array("class" => "btn btn-primary btn-xs cancel_payment"), 'visible' => 'in_array($data->approve, array(' . Payment::APPROVED . ', ' . Payment::REJECTED . '))', 'click' => 'function(){cancelPayment($(this).attr("href"));return false;}', 'url' => '$data->id'))))));
?>
	Количество: <b><?php 
echo $data['out']['count'];
 /**
  * Add task to this list
  *
  * @param string $text
  * @param User $assigned_to_user
  * @param Company $assigned_to_company
  * @return ProjectTask
  * @throws DAOValidationError
  */
 function addTask($text, $assigned_to_user = null, $assigned_to_company = null)
 {
     $task = new ProjectTask();
     $task->setText($text);
     if ($assigned_to_user instanceof User) {
         $task->setAssignedToUserId($assigned_to_user->getId());
         $task->setAssignedToCompanyId($assigned_to_user->getCompanyId());
     } elseif ($assigned_to_company instanceof Company) {
         $task->setAssignedToCompanyId($assigned_to_company->getId());
     }
     // if
     $this->attachTask($task);
     // this one will save task
     return $task;
 }
Esempio n. 21
0
<?php

Yii::app()->getClientScript()->registerScriptFile(Yii::app()->theme->baseUrl . '/js/price.js');
$c_id = Company::getId();
$url = '/uploads/c' . $c_id . '/temp/' . $project->unixtime . '/';
$html_string = $project->generateMaterialsList($url, true);
$form = $this->beginWidget('CActiveForm', array('htmlOptions' => array('class' => 'form-horizontal')));
?>
<div class="panel panel-default panel-container-default" xmlns="http://www.w3.org/1999/html">
	<?php 
if ($message) {
    echo '<div class="form-message">' . $message . '</div>';
}
echo $form->hiddenField($project, 'unixtime');
?>
    <ul class="nav nav-tabs panel-heading clearfix" id="tab-panel">
        <li class="active"><a id="top_tab-1" href="#tab-1" class="col-xs-12 text-center" data-toggle="tab">1. Paper details</a></li>
        <li><a id="top_tab-2" href="#tab-2" class="col-xs-12 text-center" data-toggle="tab">2. Price calculator</a></li>
        <?php 
if (!$logged) {
    ?>
<li><a id="top_tab-3" href="#tab-3" class="col-xs-12 text-center" data-toggle="tab">3. Contact information</a></li><?php 
}
?>
    </ul>
    <div class="tab-content">
        <div class="panel-body form-container tab-pane active" id="tab-1">
            <div class="form-group">
                <label for="type_of_paper" class="col-sm-3 control-label">Type of paper:
                    <a class="glyphicon glyphicon-info-sign" data-toggle="tooltip" title="Please select the most suitable type of paper needed. This will help the writer follow your exact instructions. If the type of paper is not on the list, please choose the option “Other”."></a>
                </label>
 /**
  * Remove specific value
  *
  * @param string $name
  * @param Company $company
  * @return boolean
  */
 function removeValue($name, $company)
 {
     $cache_id = 'company_config_options_' . $company->getId();
     $cached_values = cache_get($cache_id);
     if (is_array($cached_values) && isset($cached_values[$name])) {
         unset($cached_values[$name]);
         cache_set($cache_id, $cached_values);
     }
     // if
     return db_execute('DELETE FROM ' . TABLE_PREFIX . 'company_config_options WHERE company_id = ? AND name = ?', $company->getId(), $name);
 }
Esempio n. 23
0
 public function tableName()
 {
     return Company::getId() . '_Payment';
 }
 /**
  * Reset relations by company ID
  *
  * @param Company $company
  * @return boolean
  */
 function resetByCompany($company)
 {
     return db_execute('UPDATE ' . TABLE_PREFIX . "projects SET company_id = '0' WHERE company_id = ?", $company->getId());
 }
 protected function getTableName()
 {
     return Company::getId() . '_ProjectMessages';
 }
Esempio n. 26
0
 /**
  * Return users of specific company involeved in specific project
  *
  * @access public
  * @param Company $company
  * @param Project $project
  * @return array
  */
 function getCompanyUsersByProject(Company $company, Project $project)
 {
     $users_table = Users::instance()->getTableName(true);
     return self::getUsersByProject($project, "{$users_table}.`company_id` = " . DB::escape($company->getId()));
 }
Esempio n. 27
0
 /**
  * Return remove company from project URL
  *
  * @access public
  * @param Company $company
  * @return string
  */
 function getRemoveCompanyUrl(Company $company)
 {
     return get_url('project', 'remove_company', array('company_id' => $company->getId(), 'project_id' => $this->getId()));
 }
Esempio n. 28
0
 /**
  * Check if this contact is member of specific company
  *
  * @access public
  * @param Company $company
  * @return boolean
  */
 function isMemberOf(Company $company)
 {
     return $this->getCompanyId() == $company->getId();
 }
Esempio n. 29
0
 public function tableName()
 {
     return Company::getId() . '_Moderate';
 }
 public function folder()
 {
     return '/uploads/c' . Company::getId() . '/parts/';
 }