123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- angular.module(
- 'odoo',
- [
- 'ionic',
- 'odoo.app.controller',
- 'odoo.main.controller',
- 'odoo.sale.controller',
- 'odoo.customer.controller',
- 'odoo.configuration.controller',
- ]
- )
- .directive('onErrorSrc', function() {
- return {
- link: function(scope, element, attrs) {
- element.bind('error', function() {
- if (attrs.src != attrs.onErrorSrc) {
- attrs.$set('src', attrs.onErrorSrc);
- }
- });
- }
- }
- })
- .run(function($ionicPlatform) {
- $ionicPlatform.ready(function() {
- if (window.cordova && window.cordova.plugins.Keyboard) {
- cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
- cordova.plugins.Keyboard.disableScroll(true);
- }
- if (window.StatusBar) {
- StatusBar.overlaysWebView(false);
- StatusBar.backgroundColorByHexString('#387ef5');
- // StatusBar.styleDefault();
- // StatusBar.styleLightContent();
- // StatusBar.styleBlackOpaque();
- // StatusBar.styleBlackTranslucent();
- }
- db = window.sqlitePlugin.openDatabase({ name: 'odoo.db', location: 'default' });
- db.executeSql("CREATE TABLE IF NOT EXISTS 'user' (\n\
- 'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n\
- 'remote_id' INTEGER DEFAULT 0,\n\
- 'host' VARCHAR(35) DEFAULT 0,\n\
- 'port' INTEGER DEFAULT 0,\n\
- 'database' VARCHAR(35) DEFAULT NULL,\n\
- 'username' VARCHAR(35) DEFAULT NULL,\n\
- 'password' VARCHAR(35) DEFAULT NULL)");
- db.executeSql("CREATE TABLE IF NOT EXISTS 'partner' (\n\
- 'id' INTEGER DEFAULT NULL PRIMARY KEY AUTOINCREMENT,\n\
- 'remote_id' INTEGER DEFAULT 0,\n\
- 'modified' INTEGER DEFAULT 0,\n\
- 'modifiedDate' TEXT DEFAULT CURRENT_TIMESTAMP,\n\
- 'name' VARCHAR(35) DEFAULT NULL,\n\
- 'city' VARCHAR(35) DEFAULT NULL,\n\
- 'mobile' VARCHAR(20) DEFAULT NULL,\n\
- 'phone' VARCHAR(20) DEFAULT NULL,\n\
- 'fax' VARCHAR(20) DEFAULT NULL,\n\
- 'email' VARCHAR(100) DEFAULT NULL,\n\
- 'street' VARCHAR(35) DEFAULT NULL,\n\
- 'street2' VARCHAR(35) DEFAULT NULL,\n\
- 'image_medium' BLOB DEFAULT NULL,\n\
- 'image_small' BLOB DEFAULT NULL,\n\
- 'comment' VARCHAR(160) DEFAULT NULL,\n\
- 'customer' INTEGER DEFAULT 0,\n\
- 'employee' INTEGER DEFAULT 0,\n\
- 'is_company' INTEGER DEFAULT 0,\n\
- 'debit' INTEGER DEFAULT 0,\n\
- 'debit_limit' INTEGER DEFAULT 0,\n\
- 'opportunity_count' INTEGER DEFAULT 0,\n\
- 'contracts_count' INTEGER DEFAULT 0,\n\
- 'journal_item_count' INTEGER DEFAULT 0,\n\
- 'meeting_count' INTEGER DEFAULT 0,\n\
- 'phonecall_count' INTEGER DEFAULT 0,\n\
- 'sale_order_count' INTEGER DEFAULT NULL,\n\
- 'total_invoiced' INTEGER DEFAULT NULL);");
- });
- })
- .config(function($stateProvider, $urlRouterProvider) {
- $stateProvider
- .state('app', {
- url: '/app',
- abstract: true,
- templateUrl: 'templates/menu.html'
- })
- .state('app.main', {
- url: 'app/main',
- views: {
- 'content': {
- templateUrl: 'templates/main.html',
- controller: 'MainController'
- }
- }
- })
- .state('app.sales', {
- url: 'app/sales',
- views: {
- 'content': {
- templateUrl: 'templates/sales.html',
- controller: 'SaleController'
- }
- }
- })
- .state('app.customers', {
- url: 'app/customers',
- views: {
- 'content': {
- templateUrl: 'templates/customers.html',
- controller: 'CustomersController'
- }
- }
- })
- .state('configuration', {
- url: '/configuration',
- templateUrl: 'templates/configuration.html',
- controller: 'ConfigurationController'
- });
- $urlRouterProvider.otherwise('/configuration');
- });
|