var org = getSelectorVal($('nc_new_owner'));
var time = $('nc_new_interval_count').value;
var type = getSelectorVal($('nc_new_interval_type'));
- var req = new Request(CREATE_NON_CAT_TYPE, SESSION, name, org, time + ' ' + type );
+ var inh = $('nc_new_inhouse').checked ? 1 : null;
+
+ var req = new Request(CREATE_NON_CAT_TYPE, SESSION, name, org, time + ' ' + type, inh );
req.send(true);
var res = req.result();
if(checkILSEvent(res)) throw res;
var org = findOrgUnit( type.owning_lib() );
var row = rowTemplate.cloneNode(true);
+
row.id = 'nc_row_' + type.id();
$n(row, 'nc_name').appendChild(text(type.name()));
$n(row, 'nc_owner').appendChild(text(org.name()));
+ $n(row, 'nc_inhouse').checked = isTrue(type.in_house());
var idata = _splitInterval(type.circ_duration());
$n(row, 'nc_interval_count').value = idata[0];
interval = interval.split(/ /);
var time = interval[0];
var type = interval[1];
- if( time.match(/:/) ) return [ time.replace(/(\d{2}):\d{2}:\d{2}/,'$1'), 'hours' ];
- if( type.match(/h/) ) return [ time, 'hours' ];
- if( type.match(/d/) ) return [ time, 'days' ];
- if( type.match(/w/) ) return [ time, 'weeks' ];
- if( type.match(/m/) ) return [ time, 'months' ];
+
+ if( time.match(/:/) ) {
+ var d = time.split(/:/);
+ if(d[0] == '00') return [ d[1], 'minutes' ];
+ if(d[0] != '00' && d[1] != '00')
+ return [ parseInt(d[1]) + (d[0]*60), 'minutes' ];
+ return [ d[0], 'hours' ]
+ }
+
+ if( type.match(/mi/i) ) return [ time, 'minutes' ];
+ if( type.match(/h/i) ) return [ time, 'hours' ];
+ if( type.match(/d/i) ) return [ time, 'days' ];
+ if( type.match(/w/i) ) return [ time, 'weeks' ];
+ if( type.match(/mo/i) ) return [ time, 'months' ];
}
function ncSetRowCallbacks( type, owner, tbody, row ) {
checkDisabled( $n(row, 'nc_edit'), owner, 'UPDATE_NON_CAT_TYPE');
- /*
- mydepth = findOrgDepth( PERMS['DELETE_NON_CAT_TYPE'] );
- if( mydepth != -1 && mydepth <= tdepth ) $n(row, 'nc_delete').disabled = false;
- */
checkDisabled( $n(row, 'nc_delete'), owner, 'DELETE_NON_CAT_TYPE' );
$n(row, 'nc_edit').onclick =
$n(row, 'nc_edit_interval_count').value = idata[0];
setSelector( $n(row, 'nc_edit_interval_type'), idata[1]);
+ $n(row, 'nc_edit_inhouse').checked = isTrue(type.in_house());
+ $n(row, 'nc_edit_owner').appendChild(text( findOrgUnit(type.owning_lib()).name() ));
+
$n(row, 'nc_edit_submit').onclick = function() {
var name = $n(row, 'nc_edit_name').value;
var time = $n(row, 'nc_edit_interval_count').value;
var tp = getSelectorVal($n(row, 'nc_edit_interval_type'));
- ncEditSubmit( type, name, time + ' ' + tp );
+ var inh = $n(row, 'nc_edit_inhouse').checked ? 't' : 'f';
+ ncEditSubmit( type, name, time + ' ' + tp, inh );
};
$n(row, 'nc_edit_cancel').onclick =
name.select();
}
-function ncEditSubmit( type, name, interval ) {
+function ncEditSubmit( type, name, interval, inhouse ) {
if(!name) return;
type.name(name);
type.circ_duration(interval);
+ type.in_house(inhouse);
var req = new Request( UPDATE_NON_CAT_TYPE, SESSION, type );
req.send(true);
var res = req.result();
<br/>
- <table class='data_grid data_grid_center' width='65%'>
+ <table class='data_grid data_grid_center' width='85%'>
<thead>
- <tr><td colspan='3'>Create a new non-cataloged type</td></tr>
+ <tr><td colspan='5'>Create a new non-cataloged type</td></tr>
</thead>
<tbody>
<tr>
<td><input id='nc_new_name'> </input></td>
<td>
- <input id='nc_new_interval_count' type='text' size='2' maxlength='2' value='14'/>
+ <input id='nc_new_interval_count' type='text' size='3' maxlength='3' value='14'/>
<select id='nc_new_interval_type' style='width: 6em;'>
+ <option value='minutes'>Minutes</option>
<option value='hours'>Hours</option>
<option value='days' selected='selected'>Days</option>
<option value='weeks'>Weeks</option>
<option value='months'>Months</option>
</select>
</td>
+ <td>Circulate In-House?
+ <a href='javascript:alert($("cd_in_house_exp").innerHTML);' style='color:red'>(??)</a>
+ <input id='nc_new_inhouse' type='checkbox'/>
+ </td>
<td><select class='select_big' id='nc_new_owner' disabled='disabled'> </select></td>
<td><input id='nc_new_submit' type='submit' value='Create' disabled='disabled'> </input></td>
</tr>
<td>Name</td>
<td>Owning Location</td>
<td>Duration</td>
+ <td>Circulate In House</td>
<td>Edit</td>
<td>Delete</td>
</tr>
<td><b name='nc_name'> </b></td>
<td name='nc_owner'/>
<td>
- <input name='nc_interval_count' type='text' size='2' maxlength='2' disabled='disabled'/>
+ <input name='nc_interval_count' type='text' size='3' maxlength='3' disabled='disabled'/>
<select name='nc_interval_type' style='width: 6em;' disabled='disabled'>
+ <option value='minutes'>Minutes</option>
<option value='hours'>Hours</option>
<option value='days'>Days</option>
<option value='weeks'>Weeks</option>
<option value='months'>Months</option>
</select>
</td>
+ <td>
+ <input name='nc_inhouse' type='checkbox' disabled='disabled'/>
+ </td>
<td><input name='nc_edit' type='submit' value='Edit' disabled='disabled'/></td>
<td><input name='nc_delete' type='submit' value='Delete' disabled='disabled'/></td>
</tr>
<table class='hide_me'> <!-- repository for template rows -->
<tbody>
<tr id='nc_edit_row_temaplate' class='insert_row' edit='1'>
- <td colspan='4' align='center'>
+ <td align='center'>
<span class='padded'>
<input name='nc_edit_name' type='text'> </input>
</span>
+ </td>
+ <td name='nc_edit_owner'/>
+ <td>
<span>
- <input name='nc_edit_interval_count' type='text' size='2' maxlength='2'/>
+ <input name='nc_edit_interval_count' type='text' size='3' maxlength='3'/>
<select name='nc_edit_interval_type' style='width: 6em;'>
+ <option value='minutes'>Minutes</option>
<option value='hours'>Hours</option>
<option value='days'>Days</option>
<option value='weeks'>Weeks</option>
<option value='months'>Months</option>
</select>
</span>
+ </td>
+
+ <td><input name='nc_edit_inhouse' type='checkbox'/></td>
+
+ <td>
<span class='padded'>
<input name='nc_edit_submit' type='submit' value='Submit'> </input>
</span>
+ </td>
+ <td>
<span class='padded'>
<input name='nc_edit_cancel' type='submit' value='Cancel'> </input>
</span>
Are you sure you wish to delete the select non cataloged type?
</span>
+ <span class='hide_me' id='cd_in_house_exp'>
+ If the 'In-House' flag is set on a non-cataloged type, items that circulate as
+ that type will create "In-House" circulations. This is ideal for computer use,
+ room "rentals", etc.
+ </span>
+
</html>