Skip to content

Commit ba3e56d

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 46afc0c + 8aebaaf commit ba3e56d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+713
-415
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ before_script:
1818
- cp app/config/production/database.example.php app/config/database.php
1919
- cp app/config/production/mail.example.php app/config/mail.php
2020
- php composer.phar self-update
21+
- php composer.phar validate
2122
- php composer.phar install --prefer-source --no-interaction --dev
2223
- php artisan key:generate
2324
- php artisan migrate:install
@@ -31,4 +32,5 @@ script: phpunit
3132

3233
# configure notifications (email, IRC, campfire etc)
3334
notifications:
34-
slack: snipe:F6LWbfP6vhr3aRBoeARFG6Ti
35+
slack:
36+
secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA=

CONTRIBUTING.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Contribution Guidelines
22

3-
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the develop branch!
3+
Please submit all issues and pull requests to the [snipe/snipe-it](http://github.com/snipe/snipe-it) repository in the `develop` branch!
44

5-
As you're working on bug-fixes or features, please break them out into their own feature branches and open the pull request against your feature branch. It makes it much easier to decipher down the road, as you open multiple pull requests over time.
5+
**As you're working on bug-fixes or features, please break them out into their own feature branches and open the pull request against your feature branch**. It makes it _much_ easier to decipher down the road, as you open multiple pull requests over time, and makes it much easier for me to approve pull requests quickly.
6+
7+
If you don't have a feature in mind, but would like to contribute back to the project, check out the [open issues](https://github.com/snipe/snipe-it/issues?state=open) and see if there are any you can tackle.
8+
9+
-----
10+
11+
## Translations!
12+
13+
If you're not great at PHP and you still want to help, consider contributing some translation files (assuming, of course, that you are fluent in another language.)
14+
15+
To do so:
16+
17+
* fork the develop branch
18+
* create a new branch on your new fork (something like `translations/french`)
19+
* copy the `en` directory and name it according to the [two-letter ISO 639-1 code](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
20+
* translate the strings
21+
* submit a pull request!
22+
23+
**If you've translated Snipe IT into another language already for your own usage, please consider contributing those translation files back to the project so that everyone can benefit.**
24+
25+
Thanks!

app/controllers/admin/LicensesController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,22 @@ public function postCreate()
7979
$license->seats = e(Input::get('seats'));
8080
$license->purchase_date = e(Input::get('purchase_date'));
8181
$license->purchase_cost = e(Input::get('purchase_cost'));
82+
$license->depreciate = e(Input::get('depreciate'));
8283
$license->user_id = Sentry::getId();
8384

84-
if ($license->purchase_date == "0000-00-00") {
85+
if (($license->purchase_date == "") || ($license->purchase_date == "0000-00-00")) {
8586
$license->purchase_date = NULL;
8687
}
8788

88-
if ($license->purchase_cost == "0.00") {
89+
if (($license->purchase_cost == "") || ($license->purchase_cost == "0.00")) {
8990
$license->purchase_cost = NULL;
9091
}
9192

93+
if ($license->depreciate == "") {
94+
$license->depreciate = 0;
95+
}
96+
97+
9298
// Was the license created?
9399
if($license->save())
94100
{
@@ -98,6 +104,8 @@ public function postCreate()
98104
$license_seat = new LicenseSeat();
99105
$license_seat->license_id = $insertedId;
100106
$license_seat->user_id = Sentry::getId();
107+
$license_seat->assigned_to = 0;
108+
$license_seat->notes = NULL;
101109
$license_seat->save();
102110
}
103111

app/controllers/admin/UsersController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ public function postEdit($id = null)
267267
// Create a new validator instance from our validation rules
268268
$validator = Validator::make(Input::all(), $this->validationRules);
269269

270+
270271
// If validation fails, we'll exit the operation now.
271272
if ($validator->fails())
272273
{
@@ -287,6 +288,14 @@ public function postEdit($id = null)
287288
$user->location_id = Input::get('location_id');
288289
$user->manager_id = Input::get('manager_id');
289290

291+
if ($user->manager_id == "") {
292+
$user->manager_id = NULL;
293+
}
294+
295+
if ($user->location_id == "") {
296+
$user->location_id = NULL;
297+
}
298+
290299

291300
// Do we want to update the user password?
292301
if ($password)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class AlterDefaultLicenseDepreciationId extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
//
16+
DB::statement('ALTER TABLE licenses MODIFY column depreciation_id tinyint(1) NOT NULL DEFAULT "0"');
17+
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*
23+
* @return void
24+
*/
25+
public function down()
26+
{
27+
//
28+
}
29+
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class AlterDefaultValuesLicenses extends Migration {
7+
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
//
16+
DB::statement('ALTER TABLE license_seats MODIFY column notes text NULL');
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*
22+
* @return void
23+
*/
24+
public function down()
25+
{
26+
//
27+
}
28+
29+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
return array(
4+
'about_asset_categories' => 'About Asset Categories',
5+
'about_categories' => 'Asset categories help you organize your assets. Some example categories might be &quot;Desktops&quot;, &quot;Laptops&quot;, &quot;Mobile Phones&quot;, &quot;Tablets&quot;, and so on, but you can use asset categories any way that makes sense for you. ',
6+
'asset_categories' => 'Asset Categories',
7+
'category_name' => 'Category Name',
8+
'create' => 'Create Category',
9+
'update' => 'Update Category',
10+
11+
);

app/lang/en/admin/categories/message.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
),
1717

1818
'delete' => array(
19+
'confirm' => 'Are you sure you wish to delete this category?',
1920
'error' => 'There was an issue deleting the category. Please try again.',
2021
'success' => 'The category was deleted successfully.'
2122
)

app/lang/en/admin/categories/table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return array(
44

55
'id' => 'ID',
6-
'title' => 'Asset Category Name',
76
'parent' => 'Parent',
7+
'title' => 'Asset Category Name',
88

99
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
return array(
4+
'about_asset_depreciations' => 'About Asset Depreciations',
5+
'about_depreciations' => 'You can set up asset depreciations to depreciate assets based on straight-line depreciation.',
6+
'asset_depreciations' => 'Asset Depreciations',
7+
'create_depreciation' => 'Create Depreciation',
8+
'depreciation_name' => 'Depreciation Name',
9+
'number_of_months' => 'Number of Months',
10+
'update_depreciation' => 'Update Depreciation',
11+
12+
);

0 commit comments

Comments
 (0)