当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Utils::CheckTable方法代码示例

本文整理汇总了PHP中Vtiger_Utils::CheckTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Utils::CheckTable方法的具体用法?PHP Vtiger_Utils::CheckTable怎么用?PHP Vtiger_Utils::CheckTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Utils的用法示例。


在下文中一共展示了Vtiger_Utils::CheckTable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setRelatedList

 /**
  * Set related list information between other module
  * @param Vtiger_Module Instance of target module with which relation should be setup
  * @param String Label to display in related list (default is target module name)
  * @param Array List of action button to show ('ADD', 'SELECT')
  * @param String Callback function name of this module to use as handler
  *
  * @internal Creates table vtiger_crmentityrel if it does not exists
  */
 function setRelatedList($moduleInstance, $label = '', $actions = false, $function_name = 'get_related_list')
 {
     global $adb;
     if (empty($moduleInstance)) {
         return;
     }
     if (!Vtiger_Utils::CheckTable('vtiger_crmentityrel')) {
         Vtiger_Utils::CreateTable('vtiger_crmentityrel', '(crmid INT NOT NULL, module VARCHAR(100) NOT NULL, relcrmid INT NOT NULL, relmodule VARCHAR(100) NOT NULL)', true);
     }
     $relation_id = $this->__getRelatedListUniqueId();
     $sequence = $this->__getNextRelatedListSequence();
     $presence = 0;
     // 0 - Enabled, 1 - Disabled
     if (empty($label)) {
         $label = $moduleInstance->name;
     }
     // Allow ADD action of other module records (default)
     if ($actions === false) {
         $actions = array('ADD');
     }
     $useactions_text = $actions;
     if (is_array($actions)) {
         $useactions_text = implode(',', $actions);
     }
     $useactions_text = strtoupper($useactions_text);
     // Add column to vtiger_relatedlists to save extended actions
     Vtiger_Utils::AddColumn('vtiger_relatedlists', 'actions', 'VARCHAR(50)');
     $adb->pquery("INSERT INTO vtiger_relatedlists(relation_id,tabid,related_tabid,name,sequence,label,presence,actions) VALUES(?,?,?,?,?,?,?,?)", array($relation_id, $this->id, $moduleInstance->id, $function_name, $sequence, $label, $presence, $useactions_text));
     self::log("Setting relation with {$moduleInstance->name} [{$useactions_text}] ... DONE");
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:39,代码来源:Module.php

示例2: setRelatedList

 /**
  * Set related list information between other module
  * @param Vtiger_Module Instance of target module with which relation should be setup
  * @param String Label to display in related list (default is target module name)
  * @param Array List of action button to show ('ADD', 'SELECT')
  * @param String Callback function name of this module to use as handler
  *
  * @internal Creates table vtiger_crmentityrel if it does not exists
  */
 function setRelatedList($moduleInstance, $label = '', $actions = false, $functionName = 'get_related_list')
 {
     $adb = PearDatabase::getInstance();
     if (empty($moduleInstance)) {
         return;
     }
     if (empty($label)) {
         $label = $moduleInstance->name;
     }
     $result = $adb->pquery('SELECT relation_id FROM vtiger_relatedlists WHERE tabid=? AND related_tabid = ? AND name = ? AND label = ?;', [$this->id, $moduleInstance->id, $functionName, $label]);
     if ($result->rowCount() > 0) {
         self::log("Setting relation with {$moduleInstance->name} [{$useactions_text}] ... Error, the related module already exists");
         return;
     }
     $sequence = $this->__getNextRelatedListSequence();
     $presence = 0;
     // 0 - Enabled, 1 - Disabled
     // Allow ADD action of other module records (default)
     if ($actions === false) {
         $actions = ['ADD'];
     }
     $useactionsText = $actions;
     if (is_array($actions)) {
         $useactionsText = implode(',', $actions);
     }
     $useactionsText = strtoupper($useactionsText);
     $adb->insert('vtiger_relatedlists', ['relation_id' => $adb->getUniqueID('vtiger_relatedlists'), 'tabid' => $this->id, 'related_tabid' => $moduleInstance->id, 'name' => $functionName, 'sequence' => $sequence, 'label' => $label, 'presence' => $presence, 'actions' => $useactionsText]);
     if ($functionName == 'get_many_to_many') {
         $refTableName = Vtiger_Relation_Model::getReferenceTableInfo($moduleInstance->name, $this->name);
         if (!Vtiger_Utils::CheckTable($refTableName['table'])) {
             Vtiger_Utils::CreateTable($refTableName['table'], '(crmid INT(19) ,relcrmid INT(19),KEY crmid (crmid),KEY relcrmid (relcrmid))', true);
         }
     }
     self::log("Setting relation with {$moduleInstance->name} [{$useactions_text}] ... DONE");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:44,代码来源:Module.php

示例3: undo

    function undo($moduleName, $userId)
    {
        $adb = PearDatabase::getInstance();
        if (Vtiger_Utils::CheckTable($this->tableName)) {
            $result = $adb->pquery('UPDATE vtiger_crmentity SET deleted=1 WHERE crmid IN
								(SELECT crmid FROM ' . $this->tableName . ' WHERE userid = ? AND entitytype = ?)', array($userId, $moduleName));
            return $adb->getAffectedRowCount($result);
        }
    }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:9,代码来源:iCalLastImport.php

示例4: delete

 public function delete()
 {
     $adb = PearDatabase::getInstance();
     parent::delete();
     $fld_module = $this->getModuleName();
     $id = $this->getId();
     $uitype = $this->get('uitype');
     $typeofdata = $this->get('typeofdata');
     $fieldname = $this->getName();
     $oldfieldlabel = $this->get('label');
     $tablename = $this->get('table');
     $columnname = $this->get('column');
     $fieldtype = explode("~", $typeofdata);
     $tabId = $this->getModuleId();
     $focus = CRMEntity::getInstance($fld_module);
     $deletecolumnname = $tablename . ":" . $columnname . ":" . $fieldname . ":" . $fld_module . "_" . str_replace(" ", "_", $oldfieldlabel) . ":" . $fieldtype[0];
     $column_cvstdfilter = $tablename . ":" . $columnname . ":" . $fieldname . ":" . $fld_module . "_" . str_replace(" ", "_", $oldfieldlabel);
     $select_columnname = $tablename . ":" . $columnname . ":" . $fld_module . "_" . str_replace(" ", "_", $oldfieldlabel) . ":" . $fieldname . ":" . $fieldtype[0];
     $reportsummary_column = $tablename . ":" . $columnname . ":" . str_replace(" ", "_", $oldfieldlabel);
     if ($tablename != 'vtiger_crmentity') {
         $dbquery = 'alter table ' . $adb->quote($tablename, false) . ' drop column ' . $adb->quote($columnname, false);
         $adb->pquery($dbquery, array());
     }
     //we have to remove the entries in customview and report related tables which have this field ($colName)
     $adb->pquery('delete from vtiger_cvcolumnlist where columnname = ? ', array($deletecolumnname));
     $adb->pquery('delete from vtiger_cvstdfilter where columnname = ?', array($column_cvstdfilter));
     $adb->pquery('delete from vtiger_cvadvfilter where columnname = ?', array($deletecolumnname));
     $adb->pquery('delete from vtiger_selectcolumn where columnname = ?', array($select_columnname));
     $adb->pquery('delete from vtiger_relcriteria where columnname = ?', array($select_columnname));
     $adb->pquery('delete from vtiger_reportsortcol where columnname = ?', array($select_columnname));
     $adb->pquery('delete from vtiger_reportdatefilter where datecolumnname = ?', array($column_cvstdfilter));
     $adb->pquery('delete from vtiger_reportsummary where columnname like ?', array('%' . $reportsummary_column . '%'));
     //Deleting from convert lead mapping vtiger_table- Jaguar
     if ($fld_module == 'Leads') {
         $deletequery = 'delete from vtiger_convertleadmapping where leadfid=?';
         $adb->pquery($deletequery, array($id));
     } elseif ($fld_module == 'Accounts' || $fld_module == 'Contacts') {
         $map_del_id = array('Accounts' => 'accountfid', 'Contacts' => 'contactfid');
         $map_del_q = 'update vtiger_convertleadmapping set ' . $map_del_id[$fld_module] . '=0 where ' . $map_del_id[$fld_module] . '=?';
         $adb->pquery($map_del_q, array($id));
     }
     //HANDLE HERE - we have to remove the table for other picklist type values which are text area and multiselect combo box
     if ($this->getFieldDataType() == 'picklist' || $this->getFieldDataType() == 'multipicklist') {
         $result = $adb->pquery('SELECT * FROM `vtiger_field` WHERE `columnname` = ? AND `uitype` IN (?,?,?);', [$columnname, 15, 16, 33]);
         if (!$adb->num_rows($result)) {
             $adb->query('drop table vtiger_' . $columnname);
             //To Delete Sequence Table
             if (Vtiger_Utils::CheckTable('vtiger_' . $columnname . '_seq')) {
                 $adb->query('drop table vtiger_' . $columnname . '_seq');
             }
             $adb->pquery('delete from vtiger_picklist where name=? ', array($columnname));
         }
         $adb->pquery('delete from vtiger_picklist_dependency where `tabid` = ? AND (sourcefield=? or targetfield=?)', array($tabId, $columnname, $columnname));
     }
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:55,代码来源:Field.php

示例5: __initSchema

    /**
     * Initialize the schema (tables)
     */
    static function __initSchema()
    {
        if (empty(self::$__cacheSchemaChanges['vtiger_links'])) {
            if (!Vtiger_Utils::CheckTable('vtiger_links')) {
                Vtiger_Utils::CreateTable('vtiger_links', '(linkid INT NOT NULL PRIMARY KEY,
					tabid INT, linktype VARCHAR(20), linklabel VARCHAR(30), linkurl VARCHAR(255), linkicon VARCHAR(100), sequence INT, status INT(1) NOT NULL DEFAULT 1)', true);
                Vtiger_Utils::ExecuteQuery('CREATE INDEX link_tabidtype_idx on vtiger_links(tabid,linktype)');
            }
            self::$__cacheSchemaChanges['vtiger_links'] = true;
        }
    }
开发者ID:mslokhat,项目名称:corebos,代码行数:14,代码来源:Link.php

示例6: isLockedForModule

 public static function isLockedForModule($module)
 {
     $adb = PearDatabase::getInstance();
     if (Vtiger_Utils::CheckTable('vtiger_import_locks')) {
         $lockResult = $adb->pquery('SELECT * FROM vtiger_import_locks WHERE tabid=?', array(getTabid($module)));
         if ($lockResult && $adb->num_rows($lockResult) > 0) {
             $lockInfo = $adb->query_result_rowdata($lockResult, 0);
             return $lockInfo;
         }
     }
     return null;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:12,代码来源:Import_Lock_Controller.php

示例7: getImportInfoById

 public static function getImportInfoById($importId)
 {
     $db = PearDatabase::getInstance();
     if (Vtiger_Utils::CheckTable('vtiger_import_queue')) {
         $queueResult = $db->pquery('SELECT * FROM vtiger_import_queue WHERE importid=?', array($importId));
         if ($queueResult && $db->num_rows($queueResult) > 0) {
             $rowData = $db->raw_query_result_rowdata($queueResult, 0);
             return self::getImportInfoFromResult($rowData);
         }
     }
     return null;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:12,代码来源:Queue.php

示例8: setNoRolePicklistValues

 /**
  * Set values for picklist field (non-role based)
  * @param Array List of values to add
  *
  * @internal Creates picklist base if it does not exists
  * @access private
  */
 function setNoRolePicklistValues($values)
 {
     global $adb;
     $picklist_table = 'vtiger_' . $this->name;
     $picklist_idcol = $this->name . 'id';
     if (!Vtiger_Utils::CheckTable($picklist_table)) {
         Vtiger_Utils::CreateTable($picklist_table, "({$picklist_idcol} INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t{$this->name} VARCHAR(200) NOT NULL,\n\t\t\t\tsortorderid INT(11),\n\t\t\t\tpresence INT (11) NOT NULL DEFAULT 1)", true);
         self::log("Creating table {$picklist_table} ... DONE");
     }
     // Add value to picklist now
     $sortid = 1;
     foreach ($values as $value) {
         $presence = 1;
         // 0 - readonly, Refer function in include/ComboUtil.php
         $new_id = $adb->getUniqueId($picklist_table);
         $adb->pquery("INSERT INTO {$picklist_table}({$picklist_idcol}, {$this->name}, sortorderid, presence) VALUES(?,?,?,?)", array($new_id, $value, $sortid, $presence));
         $sortid = $sortid + 1;
     }
 }
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:26,代码来源:Field.php

示例9: initializeSchema

 public static function initializeSchema()
 {
     if (!Vtiger_Utils::CheckTable('vtiger_google_oauth')) {
         Vtiger_Utils::CreateTable('vtiger_google_oauth', '(service varchar(64),request_token text,access_token text,userid int)', true);
     }
 }
开发者ID:xrstf,项目名称:vtiger-mirror,代码行数:6,代码来源:Oauth.php

示例10: __initSchema

 /**
  * Initialize Language Schema
  * @access private
  */
 static function __initSchema()
 {
     $hastable = Vtiger_Utils::CheckTable(self::TABLENAME);
     if (!$hastable) {
         Vtiger_Utils::CreateTable(self::TABLENAME, '(id INT NOT NULL PRIMARY KEY,
                         name VARCHAR(50), label VARCHAR(30), lastupdated DATETIME, isdefault INT(1), active INT(1))', true);
         global $languages, $adb;
         foreach ($languages as $langkey => $langlabel) {
             $uniqueid = self::__getUniqueId();
             $adb->pquery('INSERT INTO ' . self::TABLENAME . '(id,name,label,lastupdated,isdefault,active) VALUES(?,?,?,?,?,?)', array($uniqueid, $langlabel, $langlabel, date('Y-m-d H:i:s', time()), 0, 1));
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:17,代码来源:LayoutExport.php

示例11: transferOwnership

 protected function transferOwnership($transferToGroup)
 {
     $db = PearDatabase::getInstance();
     $groupId = $this->getId();
     $transferGroupId = $transferToGroup->getId();
     $query = 'UPDATE vtiger_crmentity SET smownerid=? WHERE smownerid=?';
     $params = array($transferGroupId, $groupId);
     $db->pquery($query, $params);
     if (Vtiger_Utils::CheckTable('vtiger_customerportal_prefs')) {
         $query = 'UPDATE vtiger_customerportal_prefs SET prefvalue = ? WHERE prefkey = ? AND prefvalue = ?';
         $params = array($transferGroupId, 'defaultassignee', $groupId);
         $db->pquery($query, $params);
         $query = 'UPDATE vtiger_customerportal_prefs SET prefvalue = ? WHERE prefkey = ? AND prefvalue = ?';
         $params = array($transferGroupId, 'userid', $groupId);
         $db->pquery($query, $params);
     }
     //update workflow tasks Assigned User from Deleted Group to Transfer Owner
     $newOwnerModel = $this->getInstance($transferGroupId);
     if (!$newOwnerModel) {
         $newOwnerModel = Users_Record_Model::getInstanceById($transferGroupId, 'Users');
     }
     $ownerModel = $this->getInstance($groupId);
     vtws_transferOwnershipForWorkflowTasks($ownerModel, $newOwnerModel);
     vtws_updateWebformsRoundrobinUsersLists($groupId, $transferGroupId);
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:25,代码来源:Record.php

示例12: setInventoryTable

	/**
	 * Active inventory blocks
	 * @param string $moduleName Module name
	 * @return string/false
	 */
	public function setInventoryTable($type)
	{
		$db = PearDatabase::getInstance();
		$moduleName = $this->name;

		$focus = CRMEntity::getInstance($moduleName);
		$basetable = $focus->table_name;
		$basetableid = $focus->table_index;

		$tableEnds = ['_inventory', '_invfield', '_invmap'];

		if ($type === true || $type === 'true') {
			$type = 1;
		} else {
			$type = 0;
		}
		$result = $db->updateBlob('vtiger_tab', 'type', [$type, $moduleName], 'name = ?');
		$i = 0;
		while ($result && $type && $ends = $tableEnds[$i]) {
			switch ($ends) {
				case '_inventory':
					$sql = '(id int(19),seq int(10),KEY id (id),CONSTRAINT `fk_1_' . $basetable . $ends . '` FOREIGN KEY (`id`) REFERENCES `' . $basetable . '` (`' . $basetableid . '`) ON DELETE CASCADE)';
					break;
				case '_invfield':
					$sql = "(id int(19) AUTO_INCREMENT PRIMARY KEY, columnname varchar(30) NOT NULL, label varchar(50) NOT NULL, invtype varchar(30) NOT NULL,presence tinyint(1) unsigned NOT NULL DEFAULT '0',
					defaultvalue varchar(255),sequence int(10) unsigned NOT NULL, block tinyint(1) unsigned NOT NULL,displaytype tinyint(1) unsigned NOT NULL DEFAULT '1', params text, colspan tinyint(1) unsigned NOT NULL DEFAULT '1')";
					break;
				case '_invmap':
					$sql = '(module varchar(50) PRIMARY KEY,field varchar(50),tofield varchar(50))';
					break;
			}
			if (!Vtiger_Utils::CheckTable($basetable . $ends)) {
				Vtiger_Utils::CreateTable($basetable . $ends, $sql, true);
			}
			$i++;
		}
		return $result;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:43,代码来源:Inventory.php

示例13: getAll

 /**
  * Get all the language information
  * @param Boolean true to include in-active languages also, false (default)
  */
 static function getAll($includeInActive = false)
 {
     global $adb;
     $hastable = Vtiger_Utils::CheckTable(self::TABLENAME);
     $languageinfo = array();
     if ($hastable) {
         if ($includeInActive) {
             $result = $adb->pquery('SELECT * FROM ' . self::TABLENAME, array());
         } else {
             $result = $adb->pquery('SELECT * FROM ' . self::TABLENAME . ' WHERE active=?', array(1));
         }
         for ($index = 0; $index < $adb->num_rows($result); ++$index) {
             $resultrow = $adb->fetch_array($result);
             $prefix = $resultrow['prefix'];
             $label = $resultrow['label'];
             $languageinfo[$prefix] = $label;
         }
     } else {
         global $languages;
         foreach ($languages as $prefix => $label) {
             $languageinfo[$prefix] = $label;
         }
     }
     // SalesPlatform.ru begin Set ru_ru to first position
     if ($languageinfo['ru_ru']) {
         $ruLabel = $languageinfo['ru_ru'];
         unset($languageinfo['ru_ru']);
         $languageinfo = array_merge(array('ru_ru' => $ruLabel), $languageinfo);
     }
     // SalesPlatform.ru end
     return $languageinfo;
 }
开发者ID:zirf0,项目名称:openshift-salesplatform,代码行数:36,代码来源:LanguageExport.php

示例14: __initSchema

 /**
  * Initialize Layout Schema
  * @access private
  */
 static function __initSchema()
 {
     $hastable = Vtiger_Utils::CheckTable(self::TABLENAME);
     if (!$hastable) {
         Vtiger_Utils::CreateTable(self::TABLENAME, '(id INT NOT NULL PRIMARY KEY,
                         name VARCHAR(50), label VARCHAR(30), lastupdated DATETIME, isdefault INT(1), active INT(1))', true);
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:12,代码来源:LayoutExport.php

示例15: tranferGroupOwnership

/** Function to transfer the ownership of records owned by a particular group to the specified group
 * @param $groupId -- Group Id of the group which's record ownership has to be transferred:: Type integer
 * @param $transferId --  Id of the group/user to which record ownership is to be transferred:: Type integer
 * @param $transferType -- It can have only two values namely 'Groups' or 'Users'. This determines whether the owneship is to be transferred to a group or user :: Type varchar
 */
function tranferGroupOwnership($groupId, $transferId)
{
    global $log;
    $log->debug("Entering tranferGroupOwnership(" . $groupId . ") method ...");
    global $adb;
    $query = "update vtiger_crmentity set smownerid=? where smownerid=?";
    $params = array($transferId, $groupId);
    $adb->pquery($query, $params);
    if (Vtiger_Utils::CheckTable('vtiger_customerportal_prefs')) {
        $query = 'UPDATE vtiger_customerportal_prefs SET prefvalue = ? WHERE prefkey = ? AND prefvalue = ?';
        $params = array($transferId, 'defaultassignee', $groupId);
        $adb->pquery($query, $params);
        $query = 'UPDATE vtiger_customerportal_prefs SET prefvalue = ? WHERE prefkey = ? AND prefvalue = ?';
        $params = array($transferId, 'userid', $groupId);
        $adb->pquery($query, $params);
    }
    $log->debug("Exiting tranferGroupOwnership method ...");
}
开发者ID:jaimeaga84,项目名称:corebos,代码行数:23,代码来源:UserInfoUtil.php


注:本文中的Vtiger_Utils::CheckTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。