Permalink
Browse files

list items without status

  • Loading branch information...
1 parent 722d42c commit ebb151b0602cefc90630ec172b15e4eca44d13ae root committed Mar 11, 2013
Showing with 17 additions and 4 deletions.
  1. +8 −0 init.php
  2. +1 −1 php/datatables_listitems_ajax.php
  3. +8 −3 php/import.php
View
@@ -80,6 +80,14 @@
exit;
}
+ if (!is_writable("$scriptdir/tcpdf/cache")) {
+ echo "$scriptdir is not writeable by apache<br>";
+ echo "<b><big>make $scriptdir/tcpdf/cache writeable by the user running the web server</big></b><br>";
+ echo "in unix:<br><pre> chown -R $procusername $scriptdir/tcpdf/cache; chmod u+w $scriptdir/tcpdf/cache/</pre>";
+ exit;
+ }
+
+
if (!is_writable($uploaddir)) {
echo "$scriptdir is not writeable by apache<br>";
echo "<b><big>make $uploaddir writeable by the user running the web server</big></b><br>";
@@ -181,7 +181,7 @@
items
JOIN itemtypes ON items.itemtypeid=itemtypes.id
JOIN agents ON items.manufacturerid=agents.id
- JOIN statustypes ON items.status=statustypes.id
+ LEFT OUTER JOIN statustypes ON items.status=statustypes.id
JOIN users ON items.userid=users.id
LEFT OUTER JOIN locations ON items.locationid=locations.id
LEFT OUTER JOIN locareas ON items.locareaid=locareas.id
View
@@ -79,10 +79,15 @@ function array_iunique($array) {
<tr><td>File:</td><td> <input name="file" id="file" size="25" type="file"></td></tr>
<tr><td>Delimeter:</td><td> <input size=1 type=text name='delim' value=';' maxlength=1></td></tr>
<tr><td>Skip 1st row:</td><td><select name=skip1st><option value=1>Yes</option><option value=0>No</option></select></td></tr>
-<tr><td colspan=2><input type=submit value='Upload and inspect file'></td></tr>
+<tr><td colspan=2><input type=submit value='Upload file and inspect fields'></td></tr>
<input type=hidden name='nextstep' value='1'>
<input type=hidden name='imfn' value='<?=$imfn?>'>
</form>
+<p>
+Expacted format is CSV file with the following fields:<br>
+Building,Area/Room,Owner,Status,DNS Hostname,TBD,IPv4,OS,Manufacturer,Model,SN,Comments,Item Type<br>
+<br>
+TBD: to be defined<br>
<?php }?>
<?php if ($nextstep==1) {
@@ -94,7 +99,7 @@ function array_iunique($array) {
<div style='height:400px;overflow:auto'>
<table class='brdr sortable'>
<thead>
- <th>Building</th><th>Area/Room</th><th>Owner</th><th>Status</th><th>DNS Hostname</th><th>IPv4</th><th>OS</th><th>Manufacturer</th><th>Model</th><th>SN</th><th>SN2</th><th>Comments</th><th>Item Type</th></tr>
+ <th>Building</th><th>Area/Room</th><th>Owner</th><th>Status</th><th>DNS Hostname</th><th>TBD</th><th>IPv4</th><th>OS</th><th>Manufacturer</th><th>Model</th><th>SN</th><th>Comments</th><th>Item Type</th></tr>
</thead>
<tbody>
@@ -311,7 +316,7 @@ function array_iunique($array) {
//insert locareaid
$lr=getlocidsbynames($location,$locarea);
- if ($lr[0]<0) {
+ if ($lr[0]<0 && strlen($locarea)) {
$sql="INSERT INTO locareas (areaname,locationid) ".
"values ('$locarea', (SELECT id FROM locations WHERE name = '$location')) ";
db_exec($dbh,$sql);

0 comments on commit ebb151b

Please sign in to comment.