Exemple #1
0
 function postupdate()
 {
     global $adb;
     Vtiger_Deprecated::createModuleMetaFile();
     Vtiger_Access::syncSharingAccess();
     return true;
 }
Exemple #2
0
 function postupdate()
 {
     global $log, $adb;
     if ($this->filesToDeleteNew) {
         foreach ($this->filesToDeleteNew as $path) {
             $this->recurseDelete($path);
         }
     }
     $result = true;
     self::recurseCopy('cache/updates/files_new', '', true);
     $this->recurseDelete('cache/updates');
     Vtiger_Deprecated::createModuleMetaFile();
     Vtiger_Access::syncSharingAccess();
     $adb->query('SET FOREIGN_KEY_CHECKS = 1;');
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $adb->query("INSERT INTO `yetiforce_updates` (`user`, `name`, `from_version`, `to_version`, `result`) VALUES ('" . $currentUser->get('user_name') . "', '" . $this->modulenode->label . "', '" . $this->modulenode->from_version . "', '" . $this->modulenode->to_version . "','" . $result . "');", true);
     if ($result) {
         $adb->query("UPDATE vtiger_version SET current_version = '" . $this->modulenode->to_version . "';");
     }
     $dirName = 'cache/updates';
     $this->recurseDelete($dirName . '/files');
     $this->recurseDelete($dirName . '/init.php');
     $this->recurseDelete('cache/templates_c');
     header('Location: ' . vglobal('site_URL'));
     exit;
     return true;
 }
Exemple #3
0
 function postupdate()
 {
     global $adb;
     $adb->query("UPDATE vtiger_version SET `current_version` = '" . $this->modulenode->to_version . "';");
     Vtiger_Deprecated::createModuleMetaFile();
     Vtiger_Access::syncSharingAccess();
     return true;
 }
Exemple #4
0
 static function getCurrencyName($currencyid, $show_symbol = true)
 {
     $currencyInfo = self::getCurrencyInfo($currencyid);
     if ($show_symbol) {
         return sprintf("%s : %s", Vtiger_Deprecated::getTranslatedCurrencyString($currencyInfo['currency_name']), $currencyInfo['currency_symbol']);
     }
     return $currencyInfo['currency_name'];
 }
Exemple #5
0
function return_specified_module_language($language, $module)
{
    return Vtiger_Deprecated::return_app_list_strings_language($language, $module);
}
Exemple #6
0
function getModuleSequenceNumber($module, $recordId)
{
    return Vtiger_Deprecated::getModuleSequenceNumber($module, $recordId);
}
/**
 * Get field validation information
 */
function getDBValidationData($tablearray, $tabid = '')
{
    return Vtiger_Deprecated::getModuleFieldTypeOfDataInfos($tablearray, $tabid);
}
Exemple #8
0
 public static function deleteSettingsField($block, $name)
 {
     $db = PearDatabase::getInstance();
     $blockId = Vtiger_Deprecated::getSettingsBlockId($block);
     $db->delete('vtiger_settings_field', 'name = ? AND blockid=?', [$name, $blockId]);
 }
Exemple #9
0
 public function executeMigrationSchema($system, $userName, $source)
 {
     include_once $this->migration_schema . $system . '.php';
     $migrationObject = new $system();
     Vtiger_Access::syncSharingAccess();
     $migrationObject->preProcess($userName, $source);
     $migrationObject->process();
     $return = $migrationObject->postProcess();
     Vtiger_Access::syncSharingAccess();
     Vtiger_Deprecated::createModuleMetaFile();
     return $return;
 }
Exemple #10
0
function getSqlForNameInDisplayFormat($input, $module, $glue = ' ')
{
    return Vtiger_Deprecated::getSqlForNameInDisplayFormat($input, $module, $glue);
}
 public function actionMapping()
 {
     global $log, $adb;
     $log->debug("Entering VT620_to_YT::actionMapping() method ...");
     $actions = ['CreateCustomFilter', 'DuplicateRecord', 'EditableComments'];
     $count = self::countRow('vtiger_actionmapping', 'actionid');
     foreach ($actions as $action) {
         ++$count;
         $result = $adb->pquery('SELECT actionid FROM vtiger_actionmapping WHERE actionname=?;', [$action]);
         if ($adb->num_rows($result) == 0) {
             $adb->pquery("INSERT INTO `vtiger_actionmapping` (`actionid`, `actionname`, `securitycheck`) VALUES (?, ?,'0');", [$count, $action]);
         }
         $modules = [getTabid('Services'), getTabid('ServiceContracts'), getTabid('SalesOrder'), getTabid('Reservations'), getTabid('Quotes'), getTabid('PurchaseOrder'), getTabid('ProjectTask'), getTabid('ProjectMilestone'), getTabid('Project'), getTabid('Products'), getTabid('PriceBooks'), getTabid('Potentials'), getTabid('OutsourcedProducts'), getTabid('OSSTimeControl'), getTabid('OSSSoldServices'), getTabid('OSSPdf'), getTabid('OSSPasswords'), getTabid('OSSOutsourcedServices'), getTabid('OSSMailView'), getTabid('OSSMailTemplates'), getTabid('OSSEmployees'), getTabid('OSSCosts'), getTabid('Leads'), getTabid('Invoice'), getTabid('HelpDesk'), getTabid('Faq'), getTabid('Documents'), getTabid('Contacts'), getTabid('Campaigns'), getTabid('Calendar'), getTabid('Calculations'), getTabid('Assets'), getTabid('Accounts'), getTabid('Events')];
         $resultP = $adb->query("SELECT profileid FROM vtiger_profile;");
         for ($i = 0; $i < $adb->num_rows($resultP); $i++) {
             $profileId = $adb->query_result_raw($resultP, $i, 'profileid');
             if ($action == 'EditableComments') {
                 $tabid = getTabid('ModComments');
                 $resultC = $adb->pquery("SELECT activityid FROM vtiger_profile2utility WHERE profileid=? AND tabid=? AND activityid=? ;", [$profileId, $tabid, $count]);
                 if ($adb->num_rows($resultC) == 0) {
                     $adb->pquery("INSERT INTO vtiger_profile2utility (profileid, tabid, activityid, permission) VALUES  (?, ?, ?, ?)", array($profileId, $tabid, $count, 0));
                 }
                 continue;
             }
             for ($k = 0; $k < count($modules); $k++) {
                 $tabid = $modules[$k];
                 if ($action != 'DuplicateRecord' && $tabid == getTabid('Events')) {
                     continue;
                 }
                 $resultC = $adb->pquery("SELECT activityid FROM vtiger_profile2utility WHERE profileid=? AND tabid=? AND activityid=? ;", [$profileId, $tabid, $count]);
                 if ($adb->num_rows($resultC) == 0) {
                     $adb->pquery("INSERT INTO vtiger_profile2utility (profileid, tabid, activityid, permission) VALUES  (?, ?, ?, ?)", array($profileId, $tabid, $count, 0));
                 }
             }
         }
     }
     $actions = [17 => 'MassEdit', 18 => 'MassDelete', 19 => 'MassAddComment', 20 => 'MassComposeEmail', 21 => 'MassSendSMS', 22 => 'MassTransferOwnership', 23 => 'MassMoveDocuments'];
     foreach ($actions as $key => $action) {
         ++$count;
         $result = $adb->pquery('SELECT actionid FROM vtiger_actionmapping WHERE actionname=?;', [$action]);
         if ($adb->num_rows($result) == 0) {
             $adb->pquery("INSERT INTO `vtiger_actionmapping` (`actionid`, `actionname`, `securitycheck`) VALUES (?, ?,'0');", [$count, $action]);
         }
         $sql = "SELECT tabid, name  FROM `vtiger_tab` WHERE `isentitytype` = '1' AND name not in ('SMSNotifier','ModComments','PBXManager','Events','Emails','');";
         $result = $adb->query($sql);
         $resultP = $adb->query("SELECT profileid FROM vtiger_profile;");
         for ($i = 0; $i < $adb->num_rows($resultP); $i++) {
             $profileId = $adb->query_result_raw($resultP, $i, 'profileid');
             for ($k = 0; $k < $adb->num_rows($result); $k++) {
                 $insert = false;
                 $row = $adb->query_result_rowdata($result, $k);
                 $tabid = $row['tabid'];
                 if ($action == 'MassMoveDocuments' && $row['name'] == 'Documents') {
                     $insert = true;
                 }
                 if (($action == 'MassComposeEmail' || $action == 'MassSendSMS' || $action == 'MassTransferOwnership') && in_array($row['name'], ['Accounts', 'Contacts', 'Leads', 'Vendors'])) {
                     $insert = true;
                 }
                 if (!($action == 'MassTransferOwnership' && $row['name'] == 'PriceBooks') && $action != 'MassMoveDocuments' && $action != 'MassComposeEmail' && $action != 'MassSendSMS') {
                     $insert = true;
                 }
                 $resultC = $adb->pquery("SELECT activityid FROM vtiger_profile2utility WHERE profileid=? AND tabid=? AND activityid=? ;", [$profileId, $tabid, $count]);
                 if ($insert && $adb->num_rows($resultC) == 0) {
                     $adb->pquery("INSERT INTO vtiger_profile2utility (profileid, tabid, activityid, permission) VALUES  (?, ?, ?, ?)", array($profileId, $tabid, $count, 0));
                 }
             }
         }
     }
     $actions = ['ReadRecord', 'WorkflowTrigger'];
     foreach ($actions as $key => $action) {
         ++$count;
         $result = $adb->pquery('SELECT actionid FROM vtiger_actionmapping WHERE actionname=?;', [$action]);
         if ($adb->num_rows($result) == 0) {
             $adb->pquery("INSERT INTO `vtiger_actionmapping` (`actionid`, `actionname`, `securitycheck`) VALUES (?, ?,'0');", [$count, $action]);
         }
         $sql = "SELECT tabid, name  FROM `vtiger_tab` WHERE `isentitytype` = '1' AND name not in ('SMSNotifier','ModComments','PBXManager','Events','Emails','CallHistory','OSSMailView','');";
         $result = $adb->query($sql);
         $resultP = $adb->query("SELECT profileid FROM vtiger_profile;");
         for ($i = 0; $i < $adb->num_rows($resultP); $i++) {
             $profileId = $adb->query_result_raw($resultP, $i, 'profileid');
             for ($k = 0; $k < $adb->num_rows($result); $k++) {
                 $row = $adb->query_result_rowdata($result, $k);
                 $tabid = $row['tabid'];
                 $resultC = $adb->pquery("SELECT activityid FROM vtiger_profile2utility WHERE profileid=? AND tabid=? AND activityid=? ;", [$profileId, $tabid, $count]);
                 if ($adb->num_rows($resultC) == 0) {
                     $adb->pquery("INSERT INTO vtiger_profile2utility (profileid, tabid, activityid, permission) VALUES  (?, ?, ?, ?)", array($profileId, $tabid, $count, 0));
                 }
             }
         }
     }
     Vtiger_Deprecated::createModuleMetaFile();
     Vtiger_Access::syncSharingAccess();
     $log->debug("Exiting VT620_to_YT::actionMapping() method ...");
 }