瀏覽代碼

oppotunity view is selected to slide transition

robert2206 8 年之前
父節點
當前提交
5205f64755

+ 0 - 11
www/database.sql

@@ -1,11 +0,0 @@
-CREATE TABLE IF NOT EXISTS 'user' (
-'id' INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,
-'username' VARCHAR(35) DEFAULT NULL,
-'password' VARCHAR(35) DEFAULT NULL
-);
-
-CREATE TABLE IF NOT EXISTS 'log' (
-'id' INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,
-'description' VARCHAR(160) DEFAULT NULL,
-'id_user' INTEGER DEFAULT NULL REFERENCES 'user' ('id')
-);

+ 0 - 149
www/database.xml

@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
-<!-- Active URL: http://192.168.100.140:8500/wwwsqldesigner/ -->
-<sql>
-<datatypes db="sqlite">
-	<group label="Numeric" color="rgb(238,238,170)">
-		<type label="Integer" length="0" sql="INTEGER" quote=""/>
-	 	<type label="TINYINT" length="0" sql="TINYINT" quote=""/>
-	 	<type label="SMALLINT" length="0" sql="SMALLINT" quote=""/>
-	 	<type label="MEDIUMINT" length="0" sql="MEDIUMINT" quote=""/>
-	 	<type label="INT" length="0" sql="INT" quote=""/>
-		<type label="BIGINT" length="0" sql="BIGINT" quote=""/>
-		<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/>
-		<type label="Single precision" length="0" sql="FLOAT" quote=""/>
-		<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/>
-	</group>
-
-	<group label="Character" color="rgb(255,200,200)">
-		<type label="Char" length="1" sql="CHAR" quote="'"/>
-		<type label="Varchar" length="1" sql="VARCHAR" quote="'"/>
-		<type label="Text" length="0" sql="MEDIUMTEXT" re="TEXT" quote="'"/>
-		<type label="Binary" length="1" sql="BINARY" quote="'"/>
-		<type label="Varbinary" length="1" sql="VARBINARY" quote="'"/>
-		<type label="BLOB" length="0" sql="BLOB" re="BLOB" quote="'"/>
-	</group>
-
-	<group label="Date &amp; Time" color="rgb(200,255,200)">
-		<type label="Date" length="0" sql="DATE" quote="'"/>
-		<type label="Time" length="0" sql="TIME" quote="'"/>
-		<type label="Datetime" length="0" sql="DATETIME" quote="'"/>
-		<type label="Year" length="0" sql="YEAR" quote=""/>
-		<type label="Timestamp" length="0" sql="TIMESTAMP" quote="'"/>
-	</group>
-
-	<group label="Miscellaneous" color="rgb(200,200,255)">
-		<type label="ENUM" length="1" sql="ENUM" quote=""/>
-		<type label="SET" length="1" sql="SET" quote=""/>
-		<type label="Bit" length="0" sql="bit" quote=""/>
-	</group>
-</datatypes><table x="93" y="47" name="user">
-<row name="id" null="0" autoincrement="1">
-<datatype>INTEGER</datatype>
-</row>
-<row name="username" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<row name="password" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<key type="PRIMARY" name="">
-<part>id</part>
-</key>
-</table>
-<table x="423" y="83" name="log">
-<row name="id" null="0" autoincrement="1">
-<datatype>INTEGER</datatype>
-</row>
-<row name="description" null="1" autoincrement="0">
-<datatype>VARCHAR(160)</datatype>
-<default>NULL</default></row>
-<row name="id_user" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>NULL</default><relation table="user" row="id" />
-</row>
-<key type="PRIMARY" name="">
-<part>id</part>
-</key>
-</table>
-<table x="81" y="179" name="partner">
-<row name="id" null="1" autoincrement="1">
-<datatype>INTEGER</datatype>
-<default>NULL</default></row>
-<row name="remote_id" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="name" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<row name="city" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<row name="mobile" null="1" autoincrement="0">
-<datatype>VARCHAR(20)</datatype>
-<default>NULL</default></row>
-<row name="phone" null="1" autoincrement="0">
-<datatype>VARCHAR(20)</datatype>
-<default>NULL</default></row>
-<row name="fax" null="1" autoincrement="0">
-<datatype>VARCHAR</datatype>
-<default>'20'</default></row>
-<row name="email" null="1" autoincrement="0">
-<datatype>VARCHAR(100)</datatype>
-<default>NULL</default></row>
-<row name="street" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<row name="street2" null="1" autoincrement="0">
-<datatype>VARCHAR(35)</datatype>
-<default>NULL</default></row>
-<row name="image_medium" null="1" autoincrement="0">
-<datatype>BLOB</datatype>
-<default>NULL</default></row>
-<row name="image_small" null="1" autoincrement="0">
-<datatype>BLOB</datatype>
-<default>NULL</default></row>
-<row name="comment" null="1" autoincrement="0">
-<datatype>VARCHAR(160)</datatype>
-<default>NULL</default></row>
-<row name="customer" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="employee" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="is_company" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="debit" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="debit_limit" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="opportunity_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="contracts_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="journal_item_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="meeting_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="phonecall_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>0</default></row>
-<row name="sale_order_count" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>NULL</default></row>
-<row name="total_invoiced" null="1" autoincrement="0">
-<datatype>INTEGER</datatype>
-<default>NULL</default></row>
-<key type="PRIMARY" name="">
-<part>id</part>
-</key>
-</table>
-</sql>

+ 136 - 0
www/js/controllers/opportunity.controller.js

@@ -0,0 +1,136 @@
+angular.module('odoo')
+
+.controller('OpportunitiesController', function (
+    $scope,
+    $ionicActionSheet
+) {
+
+    $scope.stages = [
+                        {
+                            title: 'Nuevo'
+                        },
+                        {
+                            title: 'Muerta'
+                        },
+                        {
+                            title: 'Calificación'
+                        },
+                        {
+                            title: 'Propuesta'
+                        },
+                        {
+                            title: 'Negociación'
+                        },
+                        {
+                            title: 'Ganado'
+                        },
+                        {
+                            title: 'Perdido'
+                        }
+                    ];
+
+
+    $scope.opportunities = [
+                                {
+                                    name: 'Op. 1',
+                                    stage: 'Nuevo'
+                                },
+                                {
+                                    name: 'Op. 2',
+                                    stage: 'Perdido'
+                                },
+                                {
+                                    name: 'Op. 3',
+                                    stage: 'Propuesta'
+                                },
+                                {
+                                    name: 'Op. 1',
+                                    stage: 'Nuevo'
+                                },
+                                {
+                                    name: 'Op. 1',
+                                    stage: 'Nuevo'
+                                },
+                                {
+                                    name: 'Op. 1',
+                                    stage: 'Nuevo'
+                                }
+
+                            ];
+
+    $scope.title = 'Nuevo';
+    $scope.loading = false;
+    $scope.selected = -1;
+
+    $scope.$on("$ionicSlides.sliderInitialized", function (event, data){
+        $scope.slider = data.slider;
+    });
+
+    $scope.$on("$ionicSlides.slideChangeEnd", function (event, data) {
+        console.log($scope.slider);
+        $scope.stageChanged(data.slider.activeIndex);
+    });
+
+    /**
+     * Change the state
+     */
+    $scope.changeStage = function (mode) {
+        $scope.loading = true;
+        if (mode) {
+            $scope.slider.slideNext();
+        } else {
+            $scope.slider.slidePrev();
+        }
+        $scope.loading = false;
+    }
+
+    /**
+     * Change stage name on title
+     */
+    $scope.stageChanged = function (index) {
+        $scope.title = $scope.stages[index].title;
+        $scope.$apply();
+    }
+
+    /**
+     * Open the actionsheet action options
+     */
+    $scope.openOptions = function (index) {
+        $scope.selected = index;
+
+        $ionicActionSheet.show({
+            titleText: 'Acciones',
+            buttons: [
+                {
+                    text: '<i class="icon ion-arrow-expand positive"></i> Abrir'
+                },
+                {
+                    text: '<i class="icon ion-forward positive"></i> Mover a'
+                }
+            ],
+            destructiveText: '<i class="icon ion-trash-a assertive"></i> Eliminar',
+            cancel: function() {
+                $scope.customer = {};
+                $scope.selected = -1;
+            },
+            buttonClicked: function(index) {
+                switch (index) {
+                    case 0:
+                        $scope.show();
+                        break;
+                    case 1:
+                        $scope.addContact();
+                        break;
+                    default:
+                        $scope.show();
+                }
+                return true;
+            },
+            destructiveButtonClicked: function() {
+                $scope.delete();
+
+                return true;
+            }
+        });
+    }
+});

+ 26 - 0
www/js/controllers/preferences.controller.js

@@ -0,0 +1,26 @@
+angular.module('odoo')
+
+.controller('PreferencesController', function (
+    $scope,
+    $state,
+    $ionicPopup,
+    userStorageFactory
+) {
+
+    $scope.deleteAccount = function () {
+        $ionicPopup.prompt({
+            title: 'Confirmar',
+            template: 'Escriba ELIMINAR en el cuadro de abajo para confirmar',
+            inputType: 'text',
+            inputPlaceholder: 'ELIMINAR'
+        }).then(function (answer) {
+            if (answer == 'ELIMINAR') {
+                userStorageFactory.remove(function (ok) {
+                    $state.go('configuration');
+                }, function (err) {
+                    $ionicPopup.alert({ title: 'No se ha podido eliminar el cliente', template: JSON.stringify(err) });
+                });
+            }
+        });
+    }
+});

+ 115 - 0
www/js/factories/sales/opportunity.storage.factory.js

@@ -0,0 +1,115 @@
+angular.module('odoo')
+
+.factory('opportunitiesStorageFactory', function () {
+
+    var save = function (opportunity, success, error) {
+        var values = [
+                        opportunity.remote_id ? opportunity.remote_id : 0,
+                        1, opportunity.name ? opportunity.name : '',
+                        opportunity.description ? opportunity.description : '',
+                        opportunity.contact_name ? opportunity.contact_name : '',
+                        opportunity.phone ? opportunity.phone : '',
+                        opportunity.mobile ? opportunity.mobile : '',
+                        opportunity.fax ? opportunity.fax : '',
+                        opportunity.street ? opportunity.street : '',
+                        opportunity.street2 ? opportunity.street2 : '',
+                        opportunity.meeting_count ? opportunity.meeting_count : 0,
+                        opportunity.message_bounce ? opportunity.message_bounce : 0,
+                        opportunity.planned_cost ? opportunity.planned_cost : 0,
+                        opportunity.planned_revenue ? opportunity.planned_revenue : 0,
+                        opportunity.priority ? opportunity.priority : 2,
+                        opportunity.probability ? opportunity.probability : 0,
+                        (opportunity.type == undefined || opportunity.type == 'lead') ?  'opportunity' : opportunity.type,
+                        opportunity.partner_id ? opportunity.partner_id : 0
+                    ];
+
+        var sql = null;
+
+        if (opportunity.id) {
+            values.push(opportunity.id);
+
+            sql = 'UPDATE lead SET ' +
+                  'remote_id = ?,' +
+                  'modified = ?,' +
+                  'modifiedDate = CURRENT_TIMESTAMP,' +
+                  'name = ?,' +
+                  'description = ?,' +
+                  'contact_name = ?,' +
+                  'phone = ?,' +
+                  'mobile = ?,' +
+                  'fax = ?,' +
+                  'street = ?,' +
+                  'street2 = ?,' +
+                  'meeting_count = ?,' +
+                  'message_bounce = ?,' +
+                  'planned_cost = ?,' +
+                  'planned_revenue = ?,' +
+                  'priority = ?,' +
+                  'probability = ?,' +
+                  'type = ?,' +
+                  'partner_id = ? ' +
+                  'WHERE id = ?';
+        } else {
+            sql = 'INSERT INTO lead(' +
+                  'remote_id,' +
+                  'modified,' +
+                  'name,' +
+                  'description,' +
+                  'contact_name,' +
+                  'phone,' +
+                  'mobile,' +
+                  'fax,' +
+                  'street,' +
+                  'street2,' +
+                  'meeting_count,' +
+                  'message_bounce,' +
+                  'planned_cost,' +
+                  'planned_revenue,' +
+                  'priority,' +
+                  'probability,' +
+                  'type,' +
+                  'partner_id) ' +
+                  'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+        }
+
+        db.executeSql(sql, values, function (result) {
+            success(sql.startsWith('INSERT') ? result.insertId : opportunity.id);
+        }, function (err) {
+            error(err);
+        });
+    }
+
+    // Remove opportunity from local storage
+    var remove = function (opportunity, success, error) {
+        var values = [opportunity.id];
+        var sql = null;
+
+        if (opportunity.remote_id) {
+            sql = 'UPDATE lead SET modified = 2 WHERE id = ?';
+        } else {
+            sql = 'DELETE FROM lead WHERE id = ?'
+        }
+
+        db.executeSql(sql, values, function (result) {
+            success(result.rowsAffected);
+        }, function(err) {
+            error(err);
+        });
+    }
+
+    var removeAll = function (success, error) {
+        var sql = "DELETE FROM lead WHERE type = 'opportunity'";
+
+        db.executeSql(sql, [], function(result) {
+            success(result.rowsAffected);
+        }, function(err) {
+            error(err);
+        });
+    }
+
+    return {
+        save: save,
+        remove: remove,
+        removeAll: removeAll
+    }
+});

+ 8 - 0
www/js/factories/sales/opportunity.sync.factory.js

@@ -0,0 +1,8 @@
+angular.module('odoo')
+
+.factory('opportunitiesRemoteFactory', function () {
+
+    return {
+        
+    }
+});

+ 40 - 0
www/lib/ionic-toast/.bower.json

@@ -0,0 +1,40 @@
+{
+  "name": "ionic-toast",
+  "version": "0.4.1",
+  "authors": [
+    "rajeshwarpatlolla <rajeshwar.patlolla@gmail.com>"
+  ],
+  "description": "'ionic-toast' bower component for ionic framework applications",
+  "main": [
+    "./dist/ionic-toast.bundle.min.js"
+  ],
+  "keywords": [
+    "ionic-toast",
+    "toast",
+    "ionic",
+    "toast for ionic",
+    "toast for ionic framework"
+  ],
+  "license": "MIT",
+  "homepage": "https://github.com/rajeshwarpatlolla/ionic-toast",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "ionic": ">=0.9.27"
+  },
+  "_release": "0.4.1",
+  "_resolution": {
+    "type": "version",
+    "tag": "v0.4.1",
+    "commit": "d2e9fcab0bf0527ceecfe3fb78f8d1f47fecb436"
+  },
+  "_source": "https://github.com/rajeshwarpatlolla/ionic-toast.git",
+  "_target": "^0.4.1",
+  "_originalSource": "ionic-toast",
+  "_direct": true
+}

+ 21 - 0
www/lib/ionic-toast/LICENSE.md

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Rajeshwar Patlolla
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 131 - 0
www/lib/ionic-toast/README.md

@@ -0,0 +1,131 @@
+[![bitHound Score](https://www.bithound.io/github/rajeshwarpatlolla/ionic-toast/badges/score.svg)](https://www.bithound.io/github/rajeshwarpatlolla/ionic-toast)
+
+##Introduction:
+
+This is an `ionic-toast` bower component which can be used with any Ionic framework's application.
+
+[View Demo](http://rajeshwarpatlolla.github.io/ionic-toast-demo/demo/ "Demo") 
+
+
+##Prerequisites.
+
+1) node.js, bower and gulp.
+
+##How to use:
+
+**1)** In your project repository install the ionic-toast using bower
+
+    bower install ionic-toast --save
+
+This will install the latest version released. If you wish to install a specific version please use `bower install ionic-toast#<version number>`
+    
+**2)** Give the path of `ionic-toast.bundle.min.js` in your `index.html` file.
+
+````html
+<!-- path to ionic / angularjs files-->
+<script src="lib/ionic-toast/dist/ionic-toast.bundle.min.js"></script>
+````
+    
+**3)** In your application module inject the dependency `ionic-toast`, in order to work with the ionic toast.
+
+````javascript
+angular.module('mainModuleName', ['ionic', 'ionic-toast']){
+ //
+}
+````
+
+**4)** Inject 'ionicToast' in your controller.
+
+````javascript
+.controller('HomeCtrl', ['$scope', 'ionicToast', function($scope, ionicToast) {
+  //code here
+}])
+````
+
+**5)** In your template, you can use like below
+
+````html
+<button class="button button-block" ng-click="showToast()">Show Toast at top with close</button>
+````
+
+**6)** In your controller you have to define a function like below to show the toast
+
+````javascript
+$scope.showToast = function(){
+<!-- ionicToast.show(message, position, stick, time); -->
+  ionicToast.show('This is a toast at the top.', 'top', true, 2500);
+};
+````
+
+The arguments are as follows. The order of arguments should not be changed.
+
+a) `message` is the first argument, which takes any string message.
+
+b) `position`(Optional) is the second argument, which takes on of the three values(top, middle, bottom). default position is `top`. 
+
+c) `stick`(Optional) is the third argument, which takes either `true` or `false`. Default value is false.
+- If the value is true, the toast will not close automatically. It will be closed once you click on the close button.
+- If the value is false, the toast will close automatically, after the given time. 
+
+d) `timeout`(Optional) is the fourth argument, which takes time in milliseconds. If the value is greater than 5000, then it will be considered as 5000(5 seconds) only. The default value is 4000 milli seconds.
+
+**7)** In your controller you have to define a function like below to hide the toast
+
+````javascript
+$scope.hideToast = function(){
+  ionicToast.hide();
+};
+````
+
+
+##Screen Shots:
+
+Once you are successfully done with the above steps, you should be able to see the below screen shots.
+I have used three buttons here. 
+
+The first screen shot shows only the buttons before clicking on them.
+Once you click on the button you should see the remaining screen shots.
+ 
+![ionic-toast buttons](https://lh3.googleusercontent.com/Fc4fUe9_k6DktTMoNrpih_z5sSNoZs9XHuiyn4AcClw=w320-h568-no "ionic-toast buttons") 
+![ionic-toast top](https://lh3.googleusercontent.com/VDO5p9Z9KH6tC7zpTTk6mbkchKKBA4VYWpZuqLp9Jzc=w320-h568-no "ionic-toast top")
+![ionic-toast middle](https://lh3.googleusercontent.com/J7n3YRhRx68hIQmKLRJEKq6QfkxkAD7y_Jqc9eFDOtk=w320-h568-no "ionic-toast middle")
+![ionic-toast bottom](https://lh3.googleusercontent.com/MQyAFN9S8d8Pd05XALFcuhPiY_LNlKEIS9yWh-WKTh0=w320-h568-no "ionic-toast bottom")
+
+##Versions:
+
+### 1) v0.1.0
+The whole `ionic-toast` component functionality has been implemented, and it can be installed with the command `bower install ionic-toast --save`
+
+### 2) v0.1.1
+Bug Fix
+
+### 3) v0.2.0
+Lint issues fixed, npm packages updated, main files added in the package.json, changes in the gulp tasks.
+
+### 4) v0.3.0
+Code modularity implemented, npm packages updated.
+
+JS and CSS file is combined into one `ionic-toast.bundle.min.js` file in the dist folder.
+
+### 5) v0.4.0
+Bug fix.
+
+### 6) v0.4.1
+[Issue#21](https://github.com/rajeshwarpatlolla/ionic-toast/issues/21)
+
+
+##License:
+[MIT](https://github.com/rajeshwarpatlolla/ionic-toast/blob/master/LICENSE.md "MIT")
+
+##Contact:
+gmail : rajeshwar.patlolla@gmail.com
+
+github : https://github.com/rajeshwarpatlolla
+
+twitter : https://twitter.com/rajeshwar_9032
+
+facebook : https://www.facebook.com/rajeshwarpatlolla
+
+paypal : rajeshwar.patlolla@gmail.com
+
+Rate / Comment : http://market.ionic.io/plugins/ionictoast

+ 30 - 0
www/lib/ionic-toast/bower.json

@@ -0,0 +1,30 @@
+{
+  "name": "ionic-toast",
+  "version": "0.4.1",
+  "authors": [
+    "rajeshwarpatlolla <rajeshwar.patlolla@gmail.com>"
+  ],
+  "description": "'ionic-toast' bower component for ionic framework applications",
+  "main": [
+    "./dist/ionic-toast.bundle.min.js"
+  ],
+  "keywords": [
+    "ionic-toast",
+    "toast",
+    "ionic",
+    "toast for ionic",
+    "toast for ionic framework"
+  ],
+  "license": "MIT",
+  "homepage": "https://github.com/rajeshwarpatlolla/ionic-toast",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "ionic": ">=0.9.27"
+  }
+}

文件差異過大導致無法顯示
+ 0 - 0
www/lib/ionic-toast/dist/ionic-toast.bundle.min.js


+ 34 - 0
www/lib/ionic-toast/gulpfile.js

@@ -0,0 +1,34 @@
+var gulp = require('gulp');
+var del = require('del');
+var concat = require('gulp-concat');
+var uglify = require('gulp-uglify');
+var css2js = require("gulp-css2js");
+
+gulp.task('build', ['cssminify'], function () {
+  gulp.src(['./src/ionic-toast.js'])
+    .pipe(uglify())
+    .pipe(gulp.dest("./dist"));
+});
+
+gulp.task('css2js', function () {
+  return gulp.src("./src/*.css")
+    .pipe(css2js())
+    .pipe(gulp.dest("./dist/"));
+});
+
+gulp.task('del', function () {
+  del(['./dist/*']);
+});
+
+gulp.task('make-bundle', ['del', 'css2js'], function () {
+  return gulp.src(['./dist/*', './src/*.js'])
+    .pipe(concat('ionic-toast.bundle.min.js'))
+    .pipe(uglify())
+    .pipe(gulp.dest('./dist/'));
+});
+
+gulp.task('del-temp-files', ['make-bundle'], function () {
+  del(['./dist/style.js', './dist/ionic-toast.js']);
+});
+
+gulp.task('build', ['del-temp-files']);

+ 19 - 0
www/lib/ionic-toast/package.json

@@ -0,0 +1,19 @@
+{
+  "name": "ionic-toast",
+  "version": "0.4.1",
+  "description": "A toast for IONIC framework",
+  "main": [
+    "./dist/ionic-toast.bundle.min.js",
+    "./dist/style.css"
+  ],
+  "scripts": {},
+  "author": "https://github.com/rajeshwarpatlolla, rajeshwar.patlolla@gmail.com",
+  "license": "MIT",
+  "dependencies": {},
+  "devDependencies": {
+    "del": "^2.2.0",
+    "gulp-concat": "^2.6.0",
+    "gulp-css2js": "^1.0.2",
+    "gulp-uglify": "^1.5.3"
+  }
+}

+ 58 - 0
www/lib/ionic-toast/src/ionic-toast.css

@@ -0,0 +1,58 @@
+
+.ionic_toast {
+  z-index: 9999;
+}
+
+.toast_section {
+  color: #FFF;
+  cursor: default;
+  font-size: 1em;
+  display: none;
+  border-radius: 5px;
+  opacity: 1;
+  padding: 10px 30px 10px 10px;
+  margin: 10px;
+  position: fixed;
+  left: 0;
+  right: 0;
+  text-align: center;
+  z-index: 9999;
+  background-color: rgba(0, 0, 0, 0.75);
+}
+
+.ionic_toast_top {
+  top: 10px;
+}
+
+.ionic_toast_middle {
+  top: 40%;
+}
+
+.ionic_toast_bottom {
+  bottom: 10px;
+}
+
+.ionic_toast_close {
+  border-radius: 2px;
+  color: #CCCCCC;
+  cursor: pointer;
+  display: none;
+  position: absolute;
+  right: 4px;
+  top: 4px;
+  width: 20px;
+  height: 20px;
+}
+
+.toast_close_icon {
+  position: relative;
+  top: 1px;
+}
+
+.ionic_toast_sticky .ionic_toast_close {
+  display: block;
+}
+
+.ionic_toast_close:active {
+
+}

+ 4 - 0
www/lib/ionic-toast/src/ionic-toast.module.js

@@ -0,0 +1,4 @@
+'use strict';
+angular.module('ionic-toast', [
+  'ionic-toast.provider'
+]);

+ 90 - 0
www/lib/ionic-toast/src/ionic-toast.provider.js

@@ -0,0 +1,90 @@
+'use strict';
+angular.module('ionic-toast.provider', [])
+
+  .provider('ionicToast', function () {
+
+    var defaultConfig = {
+      position: 'top',
+      showClose: false,
+      theme: 'dark',
+      timeOut: 4000
+    };
+
+    this.configure = function (inputObj) {
+      angular.extend(defaultConfig, inputObj);
+    };
+
+
+    this.$get = ['$compile', '$document', '$interval', '$rootScope', '$templateCache', '$timeout',
+      function ($compile, $document, $interval, $rootScope, $templateCache, $timeout) {
+
+        var provider = {};
+        var $scope = $rootScope.$new();
+        var toastTimer = defaultConfig.timeOut;
+
+        var defaultScope = {
+          toastClass: '',
+          toastMessage: '',
+          toastStyle: {
+            display: 'none',
+            opacity: 0
+          }
+        };
+
+        var toastPosition = {
+          top: 'ionic_toast_top',
+          middle: 'ionic_toast_middle',
+          bottom: 'ionic_toast_bottom'
+        };
+
+        var toastTemplate = $compile($templateCache.get('ionic-toast/templates/ionic-toast.html'))($scope);
+
+        $scope.ionicToast = defaultScope;
+
+        $document.find('body').append(toastTemplate);
+
+        var toggleDisplayOfToast = function (display, opacity, callback) {
+          $scope.ionicToast.toastStyle = {
+            display: display,
+            opacity: opacity
+          };
+          $scope.ionicToast.toastStyle.opacity = opacity;
+          callback();
+        };
+
+        $scope.hideToast = function () {
+          toggleDisplayOfToast('none', 0, function () {
+          });
+        };
+
+        provider.show = function (message, position, isSticky, duration) {
+
+          if (!message) return;
+          position = position || defaultConfig.position;
+          duration = duration || defaultConfig.timeOut;
+
+          if (duration > 10000) duration = 10000;
+
+          angular.extend($scope.ionicToast, {
+            toastClass: toastPosition[position] + ' ' + (isSticky ? 'ionic_toast_sticky' : ''),
+            toastMessage: message
+          });
+
+          toggleDisplayOfToast('block', 1, function () {
+            if (isSticky)  return;
+
+            toastTimer = $timeout(function () {
+              $scope.hideToast();
+            }, duration);
+          });
+        };
+
+        provider.hide = function () {
+          $scope.hideToast();
+        };
+
+        return provider;
+
+      }
+    ];
+  });

+ 15 - 0
www/lib/ionic-toast/src/ionic-toast.run.js

@@ -0,0 +1,15 @@
+'use strict';
+angular.module('ionic-toast')
+
+  .run(['$templateCache', function ($templateCache) {
+    var toastTemplate = '<div class="ionic_toast">' +
+      '<div class="toast_section" ng-class="ionicToast.toastClass" ng-style="ionicToast.toastStyle" ng-click="hideToast()">' +
+      '<span class="ionic_toast_close">' +
+      '<i class="ion-android-close toast_close_icon"></i>' +
+      '</span>' +
+      '<span ng-bind-html="ionicToast.toastMessage"></span>' +
+      '</div>' +
+      '</div>';
+
+    $templateCache.put('ionic-toast/templates/ionic-toast.html', toastTemplate);
+  }]);

+ 12 - 0
www/templates/preferences.html

@@ -0,0 +1,12 @@
+<ion-view title="Preferences">
+    <ion-header-bar class="bar-positive">
+        <h1 class="title">Preferences</h1>
+    </ion-header-bar>
+	<ion-content>
+        <div class="list">
+            <label class="item">
+                <button class="button button-assertive button-block" name="button" ng-click="deleteAccount()">ELIMINAR CUENTA</button>
+            </label>
+        </div>
+    </ion-content>
+</ion-view>

+ 27 - 0
www/templates/sales/leadToOpportunity.html

@@ -0,0 +1,27 @@
+<ion-modal-view>
+    <ion-header-bar class="bar bar-positive">
+        <h1 class="title">Convertir a oportunidad</h1>
+        <button class="button button-clear ion-checkmark-round" style="font-size:22px !important; padding-left: 5px;" type="submit" form="conversion-form"></button>
+    </ion-header-bar>
+    <ion-content>
+        <form id="conversion-form" ng-submit="convertToOpportunity()">
+            <div class="list">
+                <label class="item item-input item-select">
+                    <span class="input-label">Acción de conversión</span>
+                    <select ng-model="conversion.action">
+                        <option value="convert" selected>Convertir</option>
+                        <option value="fuse">Fusionar</option>
+                    </select>
+                </label>
+                <label class="item item-input item-select">
+                    <span class="input-label">Cliente relacionado</span>
+                    <select ng-model="conversion.customer">
+                        <option value="create" selected>Crear</option>
+                        <option value="link">Enlazar</option>
+                        <option value="none">No enlazar</option>
+                    </select>
+                </label>
+            </div>
+        </form>
+    </ion-content>
+</ion-modal-view>

+ 21 - 0
www/templates/sales/opportunities.html

@@ -0,0 +1,21 @@
+<ion-view title="Oportunidades / <small>{{ title }}</small>">
+
+    <ion-nav-buttons side="right">
+        <button class="button button-clear ion-chevron-left bar-icon" ng-disabled="slider.isBeginning" ng-click="changeStage(0)"></i></button>
+        <button class="button button-clear ion-chevron-right bar-icon" ng-disabled="slider.isEnd" ng-click="changeStage(1)"></i></button>
+    </ion-nav-buttons>
+
+    <ion-content>
+
+        <ion-spinner class="centered-spinner" ng-show="loading" icon="lines"></ion-spinner>
+
+        <ion-slides ng-show="!loading" on-swipe-left="changeStage(0)" on-swipe-right="changeStage(1)" slider="data.slider">
+            <ion-slide-page ng-repeat="s in stages">
+                <ion-list type="card">
+                  <ion-item ng-class="{'holded': selected == $index }" on-double-tap="openOptions($index)" ng-repeat="o in opportunities">
+                      <h1>{{ o.name }}</h1>
+                  </ion-item>
+            </ion-slide-page>
+        </ion-slides>
+    </ion-content>
+</ion-view>

部分文件因文件數量過多而無法顯示