function draw() {
if(providerId) {
openils.Util.addCSSClass(dojo.byId('provider-list-div'), 'hidden');
+
console.log('in draw');
var pcrud = new openils.PermaCrud();
pcrud.retrieve('acqpro', providerId, {
drawProviderSummary();
} else {
+ openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'hidden');
console.log('in else block');
- openils.Util.removeCSSClass(dojo.byId('provider-details-div'), 'hidden');
pListGrid.loadAll({order_by:{acqpro : 'name'}});
pListGrid.onPostCreate = function(fmObject) {
location.href = location.href + '/' + fmObject.id();
}
function drawProviderSummary(child) {
- console.log(child);
- openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'visible');
- console.log('added provider.list.div');
- console.log("drawing provider-details-div");
-
var loadedTabs = {'provider-address' : true};
if(child){
if(loadedTabs[child.id]) return;
case 'tab-pro-contact':
pcListGrid.overrideEditWidgets.provider = new
dijit.form.TextBox({disabled: 'true', value: providerId});
- openils.Util.removeCSSClass(dojo.byId('contact-addr-div'), 'hidden');
pcListGrid.resetStore();
pcListGrid.loadAll( {oncomplete:function(r){
var count = 0;
pcListGrid.store.fetch( {onComplete:function(list) {
- count = list.length
- if(count>=1){
- var contactIds = [];
- dojo.forEach(list, function(item) {
- contactIds.push(pcListGrid.store.getValue(item, 'id')); }
- );
- openils.Util.addCSSClass(dojo.byId('contact-addr-div'), 'visible');
- pcaListGrid.overrideEditWidgets.contact = new
- dijit.form.FilteringSelect({store: pcListGrid.store});
- pcaListGrid.resetStore();
- pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds});
- }else{
- return;
- }
+ count = list.length
+ if(count>=1){
+ var contactIds = []; dojo.forEach(list, function(item) {
+ contactIds.push(pcListGrid.store.getValue(item, 'id')); }
+ );
+
+ pcaListGrid.overrideEditWidgets.contact = new
+ dijit.form.FilteringSelect({store: pcListGrid.store});
+ pcaListGrid.resetStore();
+ pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds});
+ }else{
+ return;
+ }
}
}
);
function getParsedTag(rowIndex, item) {
- console.log("in getParsedTag");
- console.log(item);
return item && xpathParser.parse(padListGrid.store.getValue(item, 'xpath')).tags;
}
dojo.require('dijit.form.TextBox');
dojo.require('dijit.form.CurrencyTextBox');
dojo.require('dijit.Dialog');
+dojo.require('openils.DojoPatch');
dojo.require('dojox.widget.PlaceholderMenuItem');
dojo.require('fieldmapper.OrgUtils');
dojo.require('openils.widget.OrgUnitFilteringSelect');
/** really need to put this in a shared location... */
function getOrgInfo(rowIndex, item) {
if(!item) return '';
- var orgId = this.grid.store.getValue(item, this.field);
+ var orgId = svGrid.store.getValue(item, this.field);
return fieldmapper.aou.findOrgUnit(orgId).shortname();
}
function getDateTimeField(rowIndex, item) {
if(!item) return '';
- var data = this.grid.store.getValue(item, this.field);
+ var data = svGrid.store.getValue(item, this.field);
var date = dojo.date.stamp.fromISOString(data);
return dojo.date.locale.format(date, {formatLength:'short'});
}
var svId = svGrid.store.getValue(item, 'id');
var pcrud = new openils.PermaCrud();
var survey = pcrud.retrieve('asv', svId);
- console.log(survey);
var today = new Date();
var date = dojo.date.stamp.toISOString(today);
survey.end_date(date);
sv.usr_summary('t')
else
sv.usr_summary('f');
- console.log(sv.name());
+
var pcrud = new openils.PermaCrud();
pcrud.create(sv,
{
oncomplete: function(r) {
var obj = openils.Util.readResponse(r);
- if(!obj) return console.log('no obj');
+ if(!obj) return '';
svGrid.store.newItem(asv.toStoreItem(obj));
svSurveyDialog.hide();
svId = obj.id();
document.location.href = "/eg/conify/global/action/survey/edit/"+svId;
- //redirect(svId);
}
}
);
if(stat = openils.Util.readResponse(r)) {
console.log(stat);
svGrid.store.deleteItem(item);
- // buildSVGrid();
}
_deleteFromGrid(list, ++idx);
</select>
</div>
-<div id='provider-list-div' style='height: 600px;'>
+<div id='provider-list-div'>
<div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Provider</div>
</div>
<div id='provider-summary-pane'></div>
-<div id='provider-details-div' style='height:600px;'>
-<div dojoType="dijit.layout.TabContainer" style='height:100%;' jsId='providerTabs'>
+<div id='provider-details-div'>
+<div dojoType="dijit.layout.TabContainer" style='height:100%' jsId='providerTabs'>
<div dojoType="dijit.layout.ContentPane" title='Provider Address' select='true' id='provider-address'>
editOnEnter='true'>
</table>
</div>
-
- <div id='contact-addr-div'>
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
- <div>Contact Address</div>
- <div>
- <button dojoType='dijit.form.Button' onClick='pcaListGrid.showCreateDialog()'>New Contact Address</button>
- <button dojoType='dijit.form.Button' onClick='pcaListGrid.deleteSelected()'>Delete Selected</button>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Contact Address</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='pcaListGrid.showCreateDialog()'>New Contact Address</button>
+ <button dojoType='dijit.form.Button' onClick='pcaListGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
- </div>
- <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:400px'>
- <table jsId="pcaListGrid"
- dojoType="openils.widget.AutoGrid"
- fieldOrder="['id', 'address_type', 'contact', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
- query="{id: '*'}"
- fmClass='acqpca'
- defaultCellWidth='"auto"'
- editOnEnter='true'>
-
- </table>
- </div>
- </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
+ <table jsId="pcaListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'address_type', 'contact', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
+ query="{id: '*'}"
+ fmClass='acqpca'
+ defaultCellWidth='"auto"'
+ editOnEnter='true'>
+
+ </table>
+ </div>
+
</div>
<div dojoType="dijit.layout.ContentPane" title='Attribute Definitions' id='tab-attr'>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div> Attribute Definitions</div>
<div>
- <button dojoType='dijit.form.Button' onClick='padListGrid.showCreateDialog()'>New Attribute Definition</button>
- <button dojoType='dijit.form.Button' onClick='padListGrid.deleteSelected()'>Delete Selected</button>
+ <button dojoType='dijit.form.Button' onClick='padListGrid.showCreateDialog()'>New Attribute Definition</button>
+ <button dojoType='dijit.form.Button' onClick='padListGrid.deleteSelected()'>Delete Selected</button>
</div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
[% WRAPPER default/base.tt2 %]
<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/action/survey.js'> </script>
-<h1>Survey List</h1><br/>
<script>
function formatName(inDatum) {
}
}
</script>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Survey List</div>
+ <div>
+ <button dojoType='dijit.form.Button' onclick='svNewSurvey();'>Add New Survey</button>
+ <button dojoType='dijit.form.Button' onclick='deleteFromGrid();'>Delete Selected</button>
+ <button dojoType='dijit.form.Button' onclick='endSurvey();'>End Selected Surveys</button>
+ </div>
+ </div>
-<button dojoType='dijit.form.Button' onclick='svNewSurvey();'>Add New Survey</button>
-<button dojoType='dijit.form.Button' onclick='deleteFromGrid();'>Delete Selected</button>
-<button dojoType='dijit.form.Button' onclick='endSurvey();'>End Selected Surveys</button>
-<script>dojo.require('openils.widget.GridColumnPicker');</script>
-
-<!-- column picker menu-->
-<div dojoType="openils.widget.GridColumnPicker" jsid="svGridMenu" id="svGridMenu" style="display: none;" grid='svGrid'>
- <div dojoType="dojox.widget.PlaceholderMenuItem" label="GridColumns"></div>
-</div>
<!-- grid -->
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
- <table jsId="svGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}"
- rowSelector='20px' columnReordering='true' headerMenu="svGridMenu">
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:400px'>
+ <table jsId="svGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}">
<thead>
<tr>
<th field="id">Survey ID</th>