CREATE-task# # -
FEATURE-000n-view-buying - porting to .org
[previously]
- [00:00] NEW task IN
- [] # 2919 - CREATE-task# # - ADD-FEATURE - view buying - port - ] porting the view / buying functionality into the .org version
- [*] reference example = # 2793 - CREATE-task# # -FEATURE-4900-view-bio - porting to .org - currently the MyStuff/Bio feature is not functional
- [] TLDR - 'view buying' should show 'all' 'items' that have a status value of "Need" ( and a Priaaority value of "" )
- [] these items are then organized by the warehouse, inventory and itemgroup that they appear in, aka bio_by_project, [*] based on view_priority (actually uses db viewPriority
- []
- [*] repurposing this task, ORIG = PROCESS misc - tasks that, ON = 2019-09-19, content moved to today
- [00:00] NEW task IN - prj-022 - ISSUE-001
- [x] # # - FEATURE view/buying - server error on page load
- [x] ISSUE-001 - error of @Session VS Session
- [00:00] NEW task IN
- [x] EDIT PAGE - view buying - save copy of original/current version to deprecate
- [00:00] NEW Task IN - database
- [x] EDIT db - .org - added new view_buying view, as per sql below
- [x] EDIT db - dons - added new view_buying, renamed orig table as prev_view_buying, ] delete ?
- []
- [00:00] NEW task IN - UPDATES
- [x] added isAuthenticated check on 'display' "edit links toolbar",
- [x] moved view/task link to taskName VS in "edit links toolbar",
- [*] use of code inside code block, example nested if statement, 2nd if requres @{ ... } wrapper
- >[00:00] NEW task IN - CLOSE
- [x] REM OVEd - case statement for cases based on IF called from plan, see below
- [00:00] NEW task IN - *
- [x] not seeing issue-002 - database view_buying
- [x] not seeing issue-003 - view missing required column
- [x] not seeing issue-005 - headings with no content
- [] [00:00] NEW task IN - stats bar - location and style
- [x] used NEW statsBarBio AS example
- [x] in NEW LOCATION = relocated it to directly below navHeader, [x] removed current style of "statsbar" (used absolute postioning),
- [x] created AS _statsBarBuying = itemsCount, itemsTotalCOST,
- [00:00] NEW task IN - refactor
- [x] removed unused vars
- [x] re ordered vars
- [x] renamed vars
- [] notes in source comments
- [] NEW task IN - add view for single warehouse by name
- [x] add case "warehouse" where we can get view_buying for just a single warehouse
- [x] add 4th parameter as warehouse name
- [x] http://sospep.org/view/buying/warehouse/Want/1/nations
- [00:00] NEW task IN - review
- [] dont seem to see/find any documentation for view/buying OR view/selling
- []
- [] >[00:00] NEW task IN - ISSUE-007 - stats bar functionality
- [] # # - [] stats bar - functionality -
- [x] moved 'statsBar' into '/Shared' as partial page, call RenderPage,
- [] ERROR re: - var doesnt exist in this context, RESOLUTION: changed varName to Page.varName
- [] even after changing to Page["var"] property
- [] PROBLEM WAS - shared page is rendered BEFORE values are caculated. Values are calculated in the display list items loop. Page is rendered at the top. This is why was previously using
- [] RESOLUTION =
- [1] return prev, render component after display loop, then re position (update from :using absolute position, to: ] reposition with script ] reposition with css)
- [] https://stackoverflow.com/questions/104953/position-an-html-element-relative-to-its-container-using-css
- [2] call js method - ] write vars to input hidden, ] call js method, updateStatsBar(), ] write js method updateStatsBar, -uses hidden input vars to update statsbar # values
- [] ERROR re: type passed into arg, when calling the calculateCompletedPercentage helper method
- [] [00:00] NEW task IN - git commit & merge
- [x] commit -m = {"ADD-FEATURE - bio - porting feature functionality from original sospep.com version"}
- [x] git local commited branch(ADD-FEATURE-bio)
- [x] merged branch into master
[currently]
- [00:00] NEW task IN
- [] # # -
[next]
- [00:00] NEW task IN TODO
- [x] content is left aligned -
- [] heading styles -
- [x] stats bar - location
- [x] stats bar - style
- [i] stats bar - functionality
- [x] why are 'heading's that have no content displaying -
- [i] database - update VIEW on OTHER DATABAseS, - [x] public [x] dons, [] ewa, [] other(s) ,
- [00:00] NEW task IN
- [] # # - CREATE-task# # -
- [] bio - all
- ===
- [] bio - by calendar
- [] bio - by plan/document
- [] bio - by taskgroup
- ===
- [] bio - by period - ( day, month, week, quarter, )
- [] bio - by period - custom
[reference]
- [*] sospep public - # 4900 - feature definition
query
SELECT * FROM `view_p1` WHERE priority = -5 and status = 'Completed'
SELECT * FROM view_buying WHERE status = Want || NEED ||
and priority =
create view
[] rewriting view_priorities as view BUYING
CREATE VIEW view_buying AS SELECT items.*, itemcategories.id_itemCategory, itemcategories.name_itemCategory, itemcategories.parent_id AS parent_id_itemCategory, inventories.id_inventory, inventories.name_inventory, inventories.parent_id AS parent_id_inventory, warehouses.id_warehouse, warehouses.name_warehouse
FROM items
JOIN itemcategories ON items.parent_id = itemcategories.id_itemCategory
JOIN inventories ON itemcategories.parent_id = inventories.id_inventory
JOIN warehouses ON inventories.parent_id = warehouses.id_warehouse;
displaying groups
- EDITed code on parent_id
- TO if (plan.parent_id_plan == calendar.id_calendar){
create query
[] my groups - using order by in query to get dessired grouping, WORKS but very slow
SELECT * FROM view_p1 WHERE priority=@0 && status=@1 ORDER by name_calendar ASC, name_plan ASC, name_taskgroup ASC
SELECT * FROM view_p1 WHERE priority= -1 && status='Completed' ORDER by name_calendar ASC, name_plan ASC, name_taskgroup ASC;
[] 2019-10-30
[] FIX ISSUE - ERROR missing bracket
[] TEST appears to be in div displayList
[] removed some razor comments
[] bracket matching, i think i found and eliminated the extra
[] TEST = PASS BUT - page loads, BUT no results
[] FIX ISSUE = no results display on page
[] CAUSE - suspect = view on database wasn't created properly
[] TRY =
[] RESOLUTION - created new view ,
[]
[] logic blocks from view buying
// LOGIC BL 1 - to build qry's IF called from viewCalendar's
if (planId=="000")
{ // put code here for CAL
if (String.IsNullOrEmpty(status1))
{
selectQuery = "select * from tasks where parent_id IN (select id_taskgroup from taskgroups where parent_id IN (select id_plan from plans where parent_id=@0))";
var tasks=db.Query(selectQuery,Parent);
msg ="planId= 000 and no status";
Page["tasks"] = tasks;
}
if (!String.IsNullOrEmpty(status1))
{
// EX selectQuery= "SELECT * FROM tasks WHERE parent_id IN (SELECT id_taskgroup from taskgroups where parent_id=@0 ) && status IN(@1) ORDER by name_task ASC";
selectQuery = "select * from tasks where parent_id IN (select id_taskgroup from taskgroups where parent_id IN (select id_plan from plans where parent_id=@0)) && status IN(@1) ";
var tasks= db.Query(selectQuery,parent_id, status1);
msg ="parentid 000 and HAS status";
Page["tasks"] = tasks;
}
}
// LOGIC BL 2 - to build qry IF called from viewPlan's
if (parent_id=="000")
{
// WORKs -this means 1] we dont know the tgr id bc this page is being called from a higher level, ie PLAN or CAL
// msg ="test IF tgr is 000 YES it is, the PLAN Id is: "+planId;
// - this means 1] we dont know the plan id bc this page is being called from a higher level ie CAL
//TRY 002 will just add IF statement and use selectQry1 IF */
if (String.IsNullOrEmpty(status1))
{
selectQuery= "SELECT * FROM tasks WHERE parent_id IN (SELECT id_taskgroup from taskgroups where parent_id=@0 ) && status IN('Completed','To-Do','In-Process') ORDER by name_task ASC";
// selectQuery= "SELECT * FROM tasks WHERE parent_id IN (SELECT id_taskgroup from taskgroups where parent_id=@0 ) ORDER by name_task ASC";
var tasks=db.Query(selectQuery,planId);
msg ="parentid 000 and no status";
Page["tasks"] = tasks;
}
if (!String.IsNullOrEmpty(status1))
{
selectQuery= "SELECT * FROM tasks WHERE parent_id IN (SELECT id_taskgroup from taskgroups where parent_id=@0 ) && status IN(@1) ORDER by name_task ASC";
var tasks= db.Query(selectQuery,planId, status1);
msg ="parentid 000 and HAS status";
Page["tasks"] = tasks;
}
}
// LOGIC BL 3 - to build qry's IF called from viewTaskGroups
if (!String.IsNullOrEmpty(status1) && parent_id !="000" && planId !="000")
{
selectQuery = "SELECT * FROM tasks WHERE parent_id=@0 && status IN(@1) ORDER by name_task ASC";
// REV fea 001
// selectQuery = "SELECT * FROM tasks WHERE parent_id IN(@0) && status IN(@1) ORDER by name_task ASC"; // NOT WORKING PRB with params
// try ### subqry
// selectQuery= "SELECT * FROM tasks WHERE parent_id IN (SELECT id_taskgroup from taskgroups where parent_id=@0 ) && status IN(@1) ORDER by name_task ASC";
var tasks= db.Query(selectQuery,parent_id, status1);
msg ="parentid NOT 000 and HAS status" ;
Page["tasks"] = tasks;
}
/*
// LOGIC BL 0044 - to build qry's IF called from viewTaskGroups and NOT from search page
if (String.IsNullOrEmpty(status1) && parent_id !="000" && planId !="000" && Request["qry"].IsEmpty()){
//selectQuery= "SELECT * FROM view_priority";
selectQuery= "SELECT * FROM view_priority WHERE priority=@0 and parent_id=@1";
// var tasks=db.Query(selectQuery,parent_id,-2);
var tasks=db.Query(selectQuery,Priority,parent_id);
// var sqlQ= "select name_taskgroup from taskgroups where id_taskgroup=parent_id"
//var sqlQcalendars="select * from calendars";
//var sqlQcalendars= "SELECT id_calendar,name_calendar from view_priority GROUP BY id_calendar ORDER BY name_calendar ASC";
var sqlQcalendars= "SELECT id_calendar,name_calendar,id_plan,name_plan,id_taskgroup,name_taskgroup from view_priority GROUP BY id_calendar ORDER BY name_calendar ASC";
var sqlQplans= "SELECT id_plan,name_plan,plan_parent_id from view_priority GROUP BY id_plan ORDER BY name_plan ASC";
var sqlQtaskgroups= "SELECT id_taskgroup,name_taskgroup, parent_id_taskgroup from view_priority GROUP BY id_taskgroup ORDER BY name_taskgroup ASC";
// var sqlQgroups = "SELECT id_taskgroup,name_taskgroup FROM view_priority GROUP BY id_taskgroup";
var calendars=db.Query(sqlQcalendars);
var plans = db.Query(sqlQplans);
var taskgroups = db.Query(sqlQtaskgroups);
Page["tasks"] = tasks;
Page["calendars"]= calendars;
Page["plans"] = plans;
Page["taskgroups"]=taskgroups;
msg ="HELLO WORLD! FROM status=Null, parentid !='000' and planId !='000' && Request['qry'].IsEmpty ";
}
*/
// LOGIC - BL 005 -
// Feature - 802 - Search Events by Feild MODIFIED for viewPriority IN Taskgroup/
// if (!Request["qry"].IsEmpty()){