Example #1
0
 public function save($request)
 {
     $moduleName = $request->getModule();
     $folderName = $request->get('foldername');
     $folderDesc = $request->get('folderdesc');
     $result = array();
     if (!empty($folderName)) {
         $folderModel = Documents_Folder_Model::getInstance();
         $folderModel->set('foldername', $folderName);
         $folderModel->set('description', $folderDesc);
         if ($folderModel->checkDuplicate()) {
             throw new AppException(vtranslate('LBL_FOLDER_EXISTS', $moduleName));
             exit;
         }
         $folderModel->save();
         $result = array('success' => true, 'message' => vtranslate('LBL_FOLDER_SAVED', $moduleName), 'info' => $folderModel->getInfoArray());
         $response = new Vtiger_Response();
         $response->setResult($result);
         $response->emit();
     }
 }
Example #2
0
 /**
  * Function returns an instance of Folder Model
  * @param <Array> row
  * @return Documents_Folder_Model
  */
 public static function getInstanceByArray($row)
 {
     $folderModel = Documents_Folder_Model::getInstance();
     return $folderModel->setData($row);
 }