Exemple #1
0
 /**
  *
  * @param <type> $im
  * @param <type> $product 
  */
 protected function addName(&$im, $product)
 {
     if (Mage::getStoreConfig('barcodelabel/name/print') != 1) {
         return false;
     }
     $name = $product->getName();
     $fontSize = Mage::getStoreConfig('barcodelabel/name/font_size') * $this->_coef;
     $position = $this->getPositions(Mage::getStoreConfig('barcodelabel/name/position'), true);
     $black = $this->setFontColor($im);
     $font = $this->getFont();
     $this->truncateToSize($im, $fontSize, $position, $black, $font, $name);
 }
 /**
  *
  * @param <type> $customField
  * @param <type> $reportGroupId
  * @return <type>
  */
 public function saveCustomDisplayField($customField, $reportGroupId)
 {
     $reportableService = $this->getReportableService();
     $reportableService->removeSelectedDisplayFieldGroups($reportId);
     $customFieldNo = $customField->getFieldNum();
     $name = "hs_hr_employee.custom" . $customFieldNo;
     $displayField = $this->getReportableService()->getDisplayFieldByName($name);
     if ($displayField != null) {
         $columns['displayFieldId'] = $displayField[0]->getDisplayFieldId();
     }
     $columns['reportGroupId'] = $reportGroupId;
     $columns['name'] = $name;
     $columns['label'] = $customField->getName();
     $columns['fieldAlias'] = "customField" . $customFieldNo;
     $columns['isSortable'] = "false";
     $columns['sortOrder'] = null;
     $columns['sortField'] = null;
     $columns['elementType'] = "label";
     $columns['elementProperty'] = "<xml><getter>customField" . $customFieldNo . "</getter></xml>";
     $columns['width'] = "200";
     $columns['isExportable'] = "0";
     $columns['textAlignmentStyle'] = null;
     $columns['isValueList'] = "0";
     $columns['displayFieldGroupId'] = "16";
     $columns['defaultValue'] = "---";
     $columns['isEncrypted'] = false;
     return $this->getReportableService()->saveCustomDisplayField($columns);
 }
Exemple #3
0
 /**
  * Function to retrieve block instances for a module
  * @param <type> $moduleModel - module instance
  * @return <array> - list of Vtiger_Block_Model
  */
 public static function getAllForModule($moduleModel)
 {
     $blockObjects = Vtiger_Cache::get('ModuleBlock', $moduleModel->getName());
     if (!$blockObjects) {
         $blockObjects = parent::getAllForModule($moduleModel);
         Vtiger_Cache::set('ModuleBlock', $moduleModel->getName(), $blockObjects);
     }
     $blockModelList = array();
     if ($blockObjects) {
         foreach ($blockObjects as $blockObject) {
             $blockModelList[] = self::getInstanceFromBlockObject($blockObject);
         }
     }
     return $blockModelList;
 }
Exemple #4
0
 /**
  * Saves the Id of current record to give
  * access for other methods of controller to it
  *
  * @param <type> $model - the model object
  * @param <type> $data  - saved data.
  * 
  * @return void
  * @since 1.0
  */
 protected function postSaveHook($model, $data)
 {
     $this->newsletterId = $model->getState($model->getName() . '.id');
 }
Exemple #5
0
 /**
  *@todo move the archive to another directory
  * @param <type> $repository
  * @return <type>
  */
 public function archive($repository)
 {
     chdir($this->getGitRootPath());
     $path = $repository->getPath();
     $name = $repository->getName();
     $date = $repository->getDeletionDate();
     $projectName = $repository->getProject()->getUnixName();
     $archiveName = $projectName . '_' . $name . '_' . strtotime($date) . '.tar.bz2 ';
     $cmd = ' tar cjf ' . $archiveName . ' ' . $path . ' 2>&1';
     $rcode = 0;
     $output = $this->system($cmd, $rcode);
     if ($rcode != 0) {
         throw new GitBackendException($cmd . ' -> ' . $output);
     }
     if (!empty($this->gitBackupDir) && is_dir($this->gitBackupDir)) {
         $this->system('mv ' . $this->getGitRootPath() . '/' . $archiveName . ' ' . $this->gitBackupDir . '/' . $archiveName);
     }
     return true;
 }
Exemple #6
0
 /**
  * Function to retrieve block instances for a module
  * @param <type> $moduleModel - module instance
  * @return <array> - list of Vtiger_Block_Model
  */
 public static function getAllForModule($moduleModel)
 {
     global $log;
     $log->debug("Entering ./models/Block.php::staticgetAllForModule");
     $blockObjects = Vtiger_Cache::get('ModuleBlock', $moduleModel->getName());
     if (!$blockObjects) {
         $blockObjects = parent::getAllForModule($moduleModel);
         Vtiger_Cache::set('ModuleBlock', $moduleModel->getName(), $blockObjects);
     }
     $blockModelList = array();
     if ($blockObjects) {
         foreach ($blockObjects as $blockObject) {
             $blockModelList[] = self::getInstanceFromBlockObject($blockObject);
         }
     }
     return $blockModelList;
 }