Exemplo n.º 1
0
 /**
  * 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");
 }
Exemplo n.º 2
0
 /**
  * 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");
 }
 public static function lock($importId, $module, $user)
 {
     $adb = PearDatabase::getInstance();
     if (!Vtiger_Utils::CheckTable('vtiger_import_locks')) {
         Vtiger_Utils::CreateTable('vtiger_import_locks', "(vtiger_import_lock_id INT NOT NULL PRIMARY KEY,\n\t\t\t\tuserid INT NOT NULL,\n\t\t\t\ttabid INT NOT NULL,\n\t\t\t\timportid INT NOT NULL,\n\t\t\t\tlocked_since DATETIME)", true);
     }
     $adb->pquery('INSERT INTO vtiger_import_locks VALUES(?,?,?,?,?)', array($adb->getUniqueID('vtiger_import_locks'), $user->id, getTabid($module), $importId, date('Y-m-d H:i:s')));
 }
Exemplo n.º 4
0
    /**
     * 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;
        }
    }
Exemplo n.º 5
0
    /**
     * 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), prefix VARCHAR(10), label VARCHAR(30), lastupdated DATETIME, sequence INT, 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,prefix,label,lastupdated,active) VALUES(?,?,?,?,?,?)', array($uniqueid, $langlabel, $langkey, $langlabel, date('Y-m-d H:i:s', time()), 1));
            }
        }
    }
Exemplo n.º 6
0
 public static function add($request, $user)
 {
     $db = PearDatabase::getInstance();
     if (!Vtiger_Utils::CheckTable('vtiger_import_queue')) {
         Vtiger_Utils::CreateTable('vtiger_import_queue', "(importid INT NOT NULL PRIMARY KEY,\n\t\t\t\t\t\t\t\tuserid INT NOT NULL,\n\t\t\t\t\t\t\t\ttabid INT NOT NULL,\n\t\t\t\t\t\t\t\tfield_mapping TEXT,\n\t\t\t\t\t\t\t\tdefault_values TEXT,\n\t\t\t\t\t\t\t\tmerge_type INT,\n\t\t\t\t\t\t\t\tmerge_fields TEXT,\n\t\t\t\t\t\t\t\tstatus INT default 0)", true);
     }
     if ($request->get('is_scheduled')) {
         $status = self::$IMPORT_STATUS_SCHEDULED;
     } else {
         $status = self::$IMPORT_STATUS_NONE;
     }
     $db->pquery('INSERT INTO vtiger_import_queue VALUES(?,?,?,?,?,?,?,?)', array($db->getUniqueID('vtiger_import_queue'), $user->id, getTabid($request->get('module')), Zend_Json::encode($request->get('field_mapping')), Zend_Json::encode($request->get('default_values')), $request->get('merge_type'), Zend_Json::encode($request->get('merge_fields')), $status));
 }
Exemplo n.º 7
0
 function save()
 {
     $adb = PearDatabase::getInstance();
     if (count($this->fieldData) == 0) {
         return;
     }
     if (!Vtiger_Utils::CheckTable($this->tableName)) {
         Vtiger_Utils::CreateTable($this->tableName, "(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t\t\t\tuserid INT NOT NULL,\n\t\t\t\t\tentitytype VARCHAR(200) NOT NULL,\n\t\t\t\t\tcrmid INT NOT NULL)", true);
     }
     $fieldNames = array_keys($this->fieldData);
     $fieldValues = array_values($this->fieldData);
     $adb->pquery('INSERT INTO ' . $this->tableName . '(' . implode(',', $fieldNames) . ') VALUES (' . generateQuestionMarks($fieldValues) . ')', array($fieldValues));
 }
Exemplo n.º 8
0
 /**
  * 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);
     }
 }
Exemplo n.º 9
0
 /**
  * Initialize table required for the module
  * @param String Base table name (default modulename in lowercase)
  * @param String Base table column (default modulenameid in lowercase)
  *
  * Creates basetable, customtable, grouptable <br>
  * customtable name is basetable + 'cf'<br>
  * grouptable name is basetable + 'grouprel'<br>
  */
 function initTables($basetable = false, $basetableid = false)
 {
     $this->basetable = $basetable;
     $this->basetableid = $basetableid;
     // Initialize tablename and index column names
     $lcasemodname = strtolower($this->name);
     if (!$this->basetable) {
         $this->basetable = "vtiger_{$lcasemodname}";
     }
     if (!$this->basetableid) {
         $this->basetableid = $lcasemodname . 'id';
     }
     if (!$this->customtable) {
         $this->customtable = $this->basetable . 'cf';
     }
     Vtiger_Utils::CreateTable($this->basetable, "({$this->basetableid} int(19) PRIMARY KEY, CONSTRAINT `fk_1_{$this->basetable}` FOREIGN KEY (`{$this->basetableid}`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE)", true);
     Vtiger_Utils::CreateTable($this->customtable, "({$this->basetableid} int(19) PRIMARY KEY, CONSTRAINT `fk_1_{$this->customtable}` FOREIGN KEY (`{$this->basetableid}`) REFERENCES `{$this->basetable}` (`{$this->basetableid}`) ON DELETE CASCADE)", true);
     if ($this->type == 'SupplieModule') {
         Vtiger_Utils::CreateTable($this->basetable . '_supfield', "(id int(19) AUTO_INCREMENT PRIMARY KEY, columnname varchar(30) NOT NULL,suptype varchar(30) NOT NULL,\nfieldlabel varchar(50) NOT NULL,presence int(1) unsigned NOT NULL DEFAULT '1',defaultvalue varchar(255),sequence int(10) unsigned DEFAULT NULL,\nblock int(1) unsigned DEFAULT NULL,displaytype int(1) unsigned DEFAULT NULL)", true);
         Vtiger_Utils::CreateTable($this->basetable . '_sups', "(id int(19) PRIMARY KEY)", true);
     }
 }
Exemplo n.º 10
0
 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);
     }
 }
Exemplo n.º 11
0
    /**
     * Initialize the schema.
     */
    protected static function initializeSchema()
    {
        if (!self::$schemaInitialized) {
            if (!Vtiger_Utils::CheckTable('vtiger_cron_task')) {
                Vtiger_Utils::CreateTable('vtiger_cron_task', '(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
					name VARCHAR(100) UNIQUE KEY, handler_file VARCHAR(100) UNIQUE KEY,
					frequency int, laststart int(11) unsigned, lastend int(11) unsigned, status int,module VARCHAR(100),
                                        sequence int,description TEXT )', true);
            }
            self::$schemaInitialized = true;
        }
    }
Exemplo n.º 12
0
 /**
  * Set relation between field and modules (UIType 10)
  * @param Array List of module names
  *
  * @internal Creates table vtiger_fieldmodulerel if it does not exists
  */
 function setRelatedModules($moduleNames)
 {
     // We need to create core table to capture the relation between the field and modules.
     if (!Vtiger_Utils::CheckTable('vtiger_fieldmodulerel')) {
         Vtiger_Utils::CreateTable('vtiger_fieldmodulerel', '(fieldid INT NOT NULL, module VARCHAR(100) NOT NULL, relmodule VARCHAR(100) NOT NULL, status VARCHAR(10), sequence INT)', true);
     }
     // END
     global $adb;
     foreach ($moduleNames as $relmodule) {
         $checkres = $adb->pquery('SELECT * FROM vtiger_fieldmodulerel WHERE fieldid=? AND module=? AND relmodule=?', array($this->id, $this->getModuleName(), $relmodule));
         // If relation already exist continue
         if ($adb->num_rows($checkres)) {
             continue;
         }
         $adb->pquery('INSERT INTO vtiger_fieldmodulerel(fieldid, module, relmodule) VALUES(?,?,?)', array($this->id, $this->getModuleName(), $relmodule));
         self::log("Setting {$this->name} relation with {$relmodule} ... DONE");
     }
     return true;
 }
Exemplo n.º 13
0
 /**
  *  Creates sync table if not exists
  */
 private static function intialiseUpdateSchema()
 {
     if (!Vtiger_Utils::CheckTable('vtiger_google_sync')) {
         Vtiger_Utils::CreateTable('vtiger_google_sync', '(googlemodule varchar(50),user int(10), synctime datetime,lastsynctime datetime)', true);
     }
 }
Exemplo n.º 14
0
    $stateValues = Zend_Json::decode(decode_html($stateValuesJson));
    $appKey[] = $stateValues['synctrackerid'];
}
if (!empty($appKey)) {
    $sql = 'UPDATE vtiger_wsapp SET name = ? WHERE appkey IN (' . generateQuestionMarks($appKey) . ')';
    $res = Migration_Index_View::ExecuteQuery($sql, array('Google_vtigerSyncHandler', $appKey));
}
//Ends 141
//Google Calendar sync changes
/**
 * Please refer this trac (http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8354#comment:3)
 * for configuration of vtiger to Google OAuth2
 */
global $adb;
if (!Vtiger_Utils::CheckTable('vtiger_google_oauth2')) {
    Vtiger_Utils::CreateTable('vtiger_google_oauth2', '(service varchar(20),access_token varchar(500),refresh_token varchar(500),userid int(19))', true);
    echo '<br> vtiger_google_oauth2 table created <br>';
}
//(start)Migrating GoogleCalendar ClientIds in wsapp_recordmapping to support v3
$syncTrackerIds = array();
if (Vtiger_Utils::CheckTable('vtiger_wsapp_sync_state')) {
    $sql = 'SELECT stateencodedvalues from vtiger_wsapp_sync_state WHERE name = ?';
    $result = $db->pquery($sql, array('Vtiger_GoogleCalendar'));
    $num_of_rows = $adb->num_rows($result);
    for ($i = 0; $i < $num_of_rows; $i++) {
        $stateEncodedValues = $adb->query_result($result, $i, 'stateencodedvalues');
        $htmlDecodedStateEncodedValue = decode_html($stateEncodedValues);
        $stateDecodedValues = json_decode($htmlDecodedStateEncodedValue, true);
        if (is_array($stateDecodedValues) && isset($stateDecodedValues['synctrackerid'])) {
            $syncTrackerIds[] = $stateDecodedValues['synctrackerid'];
        }
Exemplo n.º 15
0
 /**
  * Initialize table required for the module
  * @param String Base table name (default modulename in lowercase)
  * @param String Base table column (default modulenameid in lowercase)
  *
  * Creates basetable, customtable, grouptable <br>
  * customtable name is basetable + 'cf'<br>
  * grouptable name is basetable + 'grouprel'<br>
  */
 function initTables($basetable = false, $basetableid = false)
 {
     $this->basetable = $basetable;
     $this->basetableid = $basetableid;
     // Initialize tablename and index column names
     $lcasemodname = strtolower($this->name);
     if (!$this->basetable) {
         $this->basetable = "vtiger_{$lcasemodname}";
     }
     if (!$this->basetableid) {
         $this->basetableid = $lcasemodname . 'id';
     }
     if (!$this->customtable) {
         $this->customtable = $this->basetable . 'cf';
     }
     Vtiger_Utils::CreateTable($this->basetable, "({$this->basetableid} int(19) PRIMARY KEY, CONSTRAINT `fk_1_{$this->basetable}` FOREIGN KEY (`{$this->basetableid}`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE)", true);
     Vtiger_Utils::CreateTable($this->customtable, "({$this->basetableid} int(19) PRIMARY KEY, CONSTRAINT `fk_1_{$this->customtable}` FOREIGN KEY (`{$this->basetableid}`) REFERENCES `{$this->basetable}` (`{$this->basetableid}`) ON DELETE CASCADE)", true);
     if ($this->type == 1) {
         Vtiger_Utils::CreateTable($this->basetable . '_invfield', "(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',\n\t\t\t\tdefaultvalue 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')", true);
         Vtiger_Utils::CreateTable($this->basetable . '_inventory', '(id int(19),seq int(10),KEY id (id),CONSTRAINT `fk_1_' . $this->basetable . '_inventory` FOREIGN KEY (`id`) REFERENCES `' . $this->basetable . '` (`' . $this->basetableid . '`) ON DELETE CASCADE)', true);
         Vtiger_Utils::CreateTable($this->basetable . '_invmap', '(module varchar(50) PRIMARY KEY,field varchar(50),tofield varchar(50))', true);
     }
 }
Exemplo n.º 16
0
 function setRelatedModules($moduleNames, $id, $moduleName)
 {
     global $log, $adb;
     if (count($moduleNames) == 0) {
         $log->debug("Setting (setRelatedModules) relation ERROR: No module names");
         return false;
     }
     // We need to create core table to capture the relation between the field and modules.
     if (!Vtiger_Utils::CheckTable('vtiger_fieldmodulerel')) {
         Vtiger_Utils::CreateTable('vtiger_fieldmodulerel', '(fieldid INT NOT NULL, module VARCHAR(100) NOT NULL, relmodule VARCHAR(100) NOT NULL, status VARCHAR(10), sequence INT)', true);
     }
     // END
     foreach ($moduleNames as $relmodule) {
         $checkres = $adb->pquery('SELECT * FROM vtiger_fieldmodulerel WHERE fieldid=? AND module=? AND relmodule=?', [$id, $moduleName, $relmodule]);
         // If relation already exist continue
         if ($adb->num_rows($checkres)) {
             continue;
         }
         $adb->pquery('INSERT INTO vtiger_fieldmodulerel(fieldid, module, relmodule) VALUES(?,?,?)', [$id, $moduleName, $relmodule]);
         $log->debug("Setting {$moduleName} relation with {$relmodule} ... DONE");
     }
     return true;
 }
Exemplo n.º 17
0
 /**
  * Initialize table required for the module
  * @param String Base table name (default modulename in lowercase)
  * @param String Base table column (default modulenameid in lowercase)
  *
  * Creates basetable, customtable, grouptable <br>
  * customtable name is basetable + 'cf'<br>
  * grouptable name is basetable + 'grouprel'<br>
  */
 function initTables($basetable = false, $basetableid = false)
 {
     $this->basetable = $basetable;
     $this->basetableid = $basetableid;
     // Initialize tablename and index column names
     $lcasemodname = strtolower($this->name);
     if (!$this->basetable) {
         $this->basetable = "vtiger_{$lcasemodname}";
     }
     if (!$this->basetableid) {
         $this->basetableid = $lcasemodname . "id";
     }
     if (!$this->customtable) {
         $this->customtable = $this->basetable . "cf";
     }
     if (!$this->grouptable) {
         $this->grouptable = $this->basetable . "grouprel";
     }
     Vtiger_Utils::CreateTable($this->basetable, "({$this->basetableid} INT)", true);
     Vtiger_Utils::CreateTable($this->customtable, "({$this->basetableid} INT PRIMARY KEY)", true);
     if (Vtiger_Version::check('5.0.4', '<=')) {
         Vtiger_Utils::CreateTable($this->grouptable, "({$this->basetableid} INT PRIMARY KEY, groupname varchar(100))", true);
     }
 }
Exemplo n.º 18
0
	/**
	 * 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;
	}
    $tabName = $adb->query_result($allTabIdResult, $i, 'name');
    $allTabIds[$tabName] = $tabId;
}
//Adding status field for project task
$moduleInstance = Vtiger_Module::getInstance('ProjectTask');
$blockInstance = Vtiger_Block::getInstance('LBL_PROJECT_TASK_INFORMATION', $moduleInstance);
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'projecttaskstatus';
$fieldInstance->label = 'Status';
$fieldInstance->uitype = 15;
$fieldInstance->quickcreate = 0;
$blockInstance->addField($fieldInstance);
$pickListValues = array('--None--', 'Open', 'In Progress', 'Completed', 'Deferred', 'Canceled ');
$fieldInstance->setPicklistValues($pickListValues);
//Dashboard schema changes
Vtiger_Utils::CreateTable('vtiger_module_dashboard_widgets', '(id INT(19) NOT NULL AUTO_INCREMENT, linkid INT(19), userid INT(19), filterid INT(19),
				title VARCHAR(100), data VARCHAR(500) DEFAULT "[]", PRIMARY KEY(id))');
$potentials = Vtiger_Module::getInstance('Potentials');
$potentials->addLink('DASHBOARDWIDGET', 'History', 'index.php?module=Potentials&view=ShowWidget&name=History', '', '1');
$potentials->addLink('DASHBOARDWIDGET', 'Upcoming Activities', 'index.php?module=Potentials&view=ShowWidget&name=CalendarActivities', '', '2');
$potentials->addLink('DASHBOARDWIDGET', 'Funnel', 'index.php?module=Potentials&view=ShowWidget&name=GroupedBySalesStage', '', '3');
$potentials->addLink('DASHBOARDWIDGET', 'Potentials by Stage', 'index.php?module=Potentials&view=ShowWidget&name=GroupedBySalesPerson', '', '4');
$potentials->addLink('DASHBOARDWIDGET', 'Pipelined Amount', 'index.php?module=Potentials&view=ShowWidget&name=PipelinedAmountPerSalesPerson', '', '5');
$potentials->addLink('DASHBOARDWIDGET', 'Total Revenue', 'index.php?module=Potentials&view=ShowWidget&name=TotalRevenuePerSalesPerson', '', '6');
$potentials->addLink('DASHBOARDWIDGET', 'Top Potentials', 'index.php?module=Potentials&view=ShowWidget&name=TopPotentials', '', '7');
//$potentials->addLink('DASHBOARDWIDGET', 'Forecast', 'index.php?module=Potentials&view=ShowWidget&name=Forecast','', '8');
$potentials->addLink('DASHBOARDWIDGET', 'Overdue Activities', 'index.php?module=Potentials&view=ShowWidget&name=OverdueActivities', '', '9');
$accounts = Vtiger_Module::getInstance('Accounts');
$accounts->addLink('DASHBOARDWIDGET', 'History', 'index.php?module=Accounts&view=ShowWidget&name=History', '', '1');
$accounts->addLink('DASHBOARDWIDGET', 'Upcoming Activities', 'index.php?module=Accounts&view=ShowWidget&name=CalendarActivities', '', '2');
$accounts->addLink('DASHBOARDWIDGET', 'Overdue Activities', 'index.php?module=Accounts&view=ShowWidget&name=OverdueActivities', '', '3');
$contacts = Vtiger_Module::getInstance('Contacts');
    function __initializeQueue()
    {
        if (!$this->_queueinitialized) {
            if (!Vtiger_Utils::CheckTable('vtiger_mailer_queue')) {
                Vtiger_Utils::CreateTable('vtiger_mailer_queue', '(id INT NOT NULL PRIMARY KEY,
					fromname VARCHAR(100), fromemail VARCHAR(100),
					mailer VARCHAR(10), content_type VARCHAR(15), subject VARCHAR(999), body TEXT, relcrmid INT,
					failed INT(1) NOT NULL DEFAULT 0, failreason VARCHAR(255))', true);
            }
            if (!Vtiger_Utils::CheckTable('vtiger_mailer_queueinfo')) {
                Vtiger_Utils::CreateTable('vtiger_mailer_queueinfo', '(id INTEGER, name VARCHAR(100), email VARCHAR(100), type VARCHAR(7))', true);
            }
            if (!Vtiger_Utils::CheckTable('vtiger_mailer_queueattachments')) {
                Vtiger_Utils::CreateTable('vtiger_mailer_queueattachments', '(id INTEGER, path TEXT, name VARCHAR(100), encoding VARCHAR(50), type VARCHAR(100))', true);
            }
            $this->_queueinitialized = true;
        }
        return true;
    }
Exemplo n.º 21
0
    public static function initializeLogSchema()
    {
        if (!Vtiger_Utils::CheckTable('vtiger_cron_log')) {
            Vtiger_Utils::CreateTable('vtiger_cron_log', '(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
					name VARCHAR(100),start int(11) unsigned,end int(11) unsigned,iteration int,status int,logmessage TEXT)', true);
        }
    }