Ejemplo n.º 1
0
 public function __construct($param, $isCouponCode)
 {
     if ($isCouponCode && eF_checkParameter($param, 'text')) {
         $result = eF_getTableData("coupons", "*", "code='" . $param . "'");
         $param = $result[0];
     }
     parent::__construct($param);
 }
Ejemplo n.º 2
0
 public function persist()
 {
     parent::persist();
     $sourceUnit = new EfrontUnit($this->comments['content_ID']);
     EfrontEvent::triggerEvent(array("type" => EfrontEvent::NEW_COMMENT_WRITING, "lessons_ID" => $sourceUnit['lessons_ID'], "entity_ID" => $this->comments['content_ID'], "entity_name" => $sourceUnit['name']));
 }
Ejemplo n.º 3
0
 /**
  * Persist glossary properties
  *
  * This function can be used to persist with the database
  * any changes made to the current glossary object.
  * <br/>Example:
  * <code>
  * $glossary -> glossary['name'] = 'new Title';              //Change the name
  * $glossary -> persist();                                   //Make the change permanent
  * </code>
  *
  * @since 3.6.0
  * @access public
  */
 public function persist()
 {
     // added to fix http://forum.efrontlearning.net/viewtopic.php?f=5&t=2851&p=14715
     if (mb_substr($this->glossary['info'], 0, 3) == "<p>") {
         $this->glossary['info'] = mb_substr($this->glossary['info'], 3);
         if (mb_substr($this->glossary['info'], -4, 4) == "</p>") {
             $this->glossary['info'] = mb_substr($this->glossary['info'], 0, -4);
         }
     }
     parent::persist();
     EfrontSearch::removeText('glossary', $this->glossary['id'], 'data');
     EfrontSearch::insertText($this->glossary['info'], $this->glossary['id'], "glossary", "data");
     EfrontSearch::removeText('glossary', $this->glossary['id'], 'title');
     EfrontSearch::insertText($this->glossary['title'], $this->glossary['id'], "glossary", "title");
 }
Ejemplo n.º 4
0
 /**
  *
  * @return unknown_type
  */
 public static function getAll()
 {
     $themes = EfrontCache::getInstance()->getCache('themes');
     if (!$themes) {
         $themes = parent::getAll("themes", true);
         EfrontCache::getInstance()->setCache('themes', $themes);
     }
     return $themes;
 }
Ejemplo n.º 5
0
         $form->addElement("select", $field['name'], $field['description'], unserialize($field['options']), 'class = " inputSelect"');
         break;
     case 'checkbox':
         $form->addElement("advcheckbox", $field['name'], $field['description'], null, 'class = "inputCheckbox"', array(0, 1));
         break;
     case 'text':
         $form->addElement("text", $field['name'], $field['description'], 'class = "inputText"');
         break;
     case 'textarea':
         $element = $form->addElement("textarea", $field['name'], $field['description'], 'class = "inputText"');
         $element->setCols(40);
         $element->setRows(2);
         break;
     case 'date':
         $options = unserialize($field['options']);
         $form->addElement(EfrontEntity::createDateElement($form, $field['name'], $field['description'], array('minYear' => $options['year_range_from'], 'maxYear' => $options['year_range_to'], 'include_time' => $options['include_time'])));
         break;
     default:
         break;
 }
 if ($field['mandatory']) {
     $form->addRule($field['name'], _THEFIELD . ' "' . $field['description'] . '" ' . _ISMANDATORY, 'required', null, 'client');
 }
 if ($field['rule']) {
     $form->addRule($field['name'], _INVALIDFIELDDATA, 'checkRule', $field['rule']);
 }
 if ($field['type'] == 'date' && $field['default_value'] == 0) {
     $form->setDefaults(array($field['name'] => time()));
 } else {
     $form->setDefaults(array($field['name'] => $field['default_value']));
 }
 /**
  * (non-PHPdoc)
  * @see libraries/EfrontEntity#delete()
  */
 public function delete()
 {
     $folderMessages = eF_getTableData("f_personal_messages", "id", "f_folders_ID=" . $this->{$this->entity}['id']);
     foreach ($folderMessages as $message) {
         eF_PersonalMessage::eF_deletePersonalMessage($message['id']);
     }
     $folderDirectory = new EfrontDirectory(G_UPLOADPATH . $this->{$this->entity}['users_LOGIN'] . '/message_attachments/' . $this->{$this->entity}['name']);
     $folderDirectory->delete();
     parent::delete();
 }
Ejemplo n.º 7
0
 $form->addElement('text', 'mother_tongue', _MOTHERTONGUE, 'class = "inputText" ');
 $form->addElement('text', 'nationality', _NATIONALITY, 'class = "inputText" ');
 $form->addElement('text', 'address', _ADDRESS, 'class = "inputText" ');
 $form->addElement('text', 'city', _CITY, 'class = "inputText" ');
 $form->addElement('text', 'country', _COUNTRY, 'class = "inputText" ');
 $form->addElement('text', 'homephone', _HOMEPHONE, 'class = "inputText" ');
 $form->addElement('text', 'mobilephone', _MOBILEPHONE, 'class = "inputText" ');
 $form->addElement('text', 'office', _OFFICE, 'class = "inputText" ');
 $form->addElement('text', 'company_internal_phone', _COMPANYINTERNALPHONE, 'class = "inputText" ');
 $form->addElement('text', 'afm', _VATREGNUMBER, 'class = "inputText" ');
 $form->addElement('text', 'doy', _TAXOFFICE, 'class = "inputText" ');
 $form->addElement('text', 'police_id_number', _POLICEIDNUMBER, 'class = "inputText" ');
 $form->addElement('text', 'work_permission_data', _WORKPERMISSIONDATA, 'class = "inputText"');
 $form->addElement('text', 'employement_type', _EMPLOYMENTTYPE, 'class = "inputText"');
 $form->addElement(EfrontEntity::createDateElement($form, 'hired_on', _HIREDON, array('minYear' => 1960, 'maxYear' => date("Y") + 1, 'addEmptyOption' => true, 'format' => getDateFormat())));
 $form->addElement(EfrontEntity::createDateElement($form, 'left_on', _LEFTON, array('minYear' => 1960, 'maxYear' => date("Y") + 1, 'addEmptyOption' => true, 'format' => getDateFormat())));
 $form->addElement('text', 'wage', _WAGE, 'class = "inputText"');
 $form->addElement('select', 'marital_status', _MARITALSTATUS, array("0" => _SINGLE, "1" => _MARRIED), 'class = "inputText" ');
 $form->addElement('text', 'bank', _BANK, 'class = "inputText" ');
 $form->addElement('text', 'bank_account', _BANKACCOUNT, 'class = "inputText" ');
 $form->addElement('select', 'way_of_working', _WAYOFWORKING, array("" => "", "0" => _FULLTIME, "1" => _PARTTIME, "2" => _CASUAL), 'class = "inputText" id="way_of_working"');
 $form->addElement('advcheckbox', 'driving_licence', _DRIVINGLICENSE, null, 'class = "inputCheckbox"');
 $form->addElement('advcheckbox', 'national_service_completed', _NATIONALSERVICECOMPLETED, null, 'class = "inputCheckbox"');
 $form->addElement('advcheckbox', 'transport', _TRANSPORTMEANS, null, 'class = "inputCheckbox"');
 $form->setDefaults($editedEmployee->employee);
 if ($constrainAccess != 'all') {
     $form->addElement('submit', 'submit_personal_details', _SUBMIT, 'class = "flatButton"');
     $form->freeze($constrainAccess);
 } else {
     $form->freeze();
 }
Ejemplo n.º 8
0
 /**
  * Delete the news
  *
  * This function is used to delete the current news.
  * All related information is lost, as well as files associated
  * with the news.
  * <br/>Example:
  * <code>
  * $news = new news(12);                //Instantiate news with id 12
  * $news -> delete();                            //Delete news and all associated information
  * </code>
  *
  * @since 3.6.0
  * @access public
  */
 public function delete()
 {
     parent::delete();
     EfrontSearch::removeText('news', $this->news['id'], 'title');
     EfrontSearch::removeText('news', $this->news['id'], 'data');
 }
Ejemplo n.º 9
0
 /**
  * (non-PHPdoc)
  * @see libraries/EfrontEntity#persist()
  */
 public function persist()
 {
     parent::persist();
     EfrontSearch::removeText('f_poll', $this->{$this->entity}['id'], 'title');
     EfrontSearch::insertText($fields['title'], $this->{$this->entity}['id'], "f_poll", "title");
 }