Forums / Addon Admin Tools / Admin Notes Advanced

Admin Notes Advanced

Started by paulm on 10 Sep 2008, 8:48 PM · Views: 30,028

Results 41 to 60 of 126
30 Oct 2009, 6:23 AM
#41
tj1 avatar

tj1

Totally Zenned

Join Date:
Mar 2005
Location:
California
Posts:
628
Plugin Contributions:
0

Admin Notes Advanced

The version I have reads v0.951

I tried attaching the the note when viewing the order, but the note would only show when viewing that one one, it will not show when viewing any other order from that customer.

I also tried attaching the note when displaying the customer details, but then the note will only show when viewing the customer details, not when displaying order from the customer.

What I'm trying to do is attach a note to a customer and have the note displayed when ANY order from that customer is displayed.
What is the correct way to do this?

Thank you.

20 Nov 2009, 11:17 AM
#42
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

rmjr:

I added the module per the readme.txt instructions and copied the buttons also, but I do not see the ADD NOTE button icons. Is there a step that I missed?Strange.... I took a look at readme-notes-buttons.txt and the code, but I can't find any errors. Maybe other users can confirm that the buttons do (not) show ater adding the code as described in readme-notes-buttons.txt ?

20 Nov 2009, 11:26 AM
#43
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

tj1:

The version I have reads v0.951

I tried attaching the the note when viewing the order, but the note would only show when viewing that one one, it will not show when viewing any other order from that customer.That is correct.

tj1:

The I also tried attaching the note when displaying the customer details, but then the note will only show when viewing the customer details, not when displaying order from the customer.That is not correct. I can not reproduce this though. If I create a customers note it shows on the customer details and on all his/her orders.
(should work on version >= 0.95, but just to be sure you can update the files to the latest version)

23 Jan 2010, 10:56 AM
#44
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

Uploaded version 0.97

  • Improved notes notifier layout, and the notes notify messages a now grouped by category (especially useful when there a lots of active notes ).

  • To update from 0.96 only overwrite the init_notes_notifier.php file

(Probably) available soon at:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1210

11 Feb 2010, 9:17 AM
#45
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Admin Notes Advanced

This is a very useful mod, thanks for sharing your work!

I'm trying to add an indicator that will be visible on the Orders page. If a Customer Note exists, a small indicator would appear on the order line related to that customer.

So I thought if I added something like this to orders.php, I should be able to get that to appear:

$notes_active_query = ("SELECT * FROM notes");  	  	  
$notes_active_results = $db->Execute($notes_active_query);
        
while(!$notes_active_results->EOF){
 if($notes_active_results->fields['customers_id'] == $orders->fields['customers_id']){

echo '<a href="' . zen_href_link('notes.php?page1', 'nID=' . $notes_active_results->fields['notes_id'], 'NONSSL') . '">' . zen_image(DIR_WS_ICONS . 'file.gif', 'メモー' . ' ' . TABLE_HEADING_CUSTOMERS) . '</a>';
break;
}
else {
break;
}
}

This seems to work, but the problem is, I can't for the life of me figure out why that select query seems to only pull the first record out of the notes table. Anybody have an idea?

11 Feb 2010, 9:52 AM
#46
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

It's because you added the break.

And just before closing the while loop you have to add ```
$notes_active_results->MoveNext();

(else the while loop will never end if a record is found)

Also I would recommend to add something like WHERE customers_id = $orders->fields['customers_id'] to the SELECT query, because otherwise you will select and loop through ALL notes on every order. You only need to select and loop through the ones that have the customers_id that belongs to the current order.
11 Feb 2010, 10:05 AM
#47
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

And it's better not to hardcode the notes table name.

I would try a query like this:

$notes_active_query = ("SELECT * FROM " . TABLE_NOTES . " WHERE customers_id='" . $orders->fields['customers_id']  . "'");

And if you only need the notes_id anyway you can also use:

$notes_active_query = ("SELECT notes_id FROM " . TABLE_NOTES . " WHERE customers_id='" . $orders->fields['customers_id']  . "'");
```to save some more resources :cool:
11 Feb 2010, 12:34 PM
#48
jonathanbee avatar

jonathanbee

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Admin Notes Advanced

paulm, thank you!!!! That last select statement was perfect! :clap:

4 Mar 2010, 9:27 AM
#49
fleischmann avatar

fleischmann

New Zenner

Join Date:
Sep 2009
Posts:
4
Plugin Contributions:
0

Re: Admin Notes Advanced

hello,

it is possible to include the name of the customer as a drop down table in the "edit customer" field.?

thank you!

4 Mar 2010, 10:15 AM
#50
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

Possible yes, if time permits..... (although it would not be the best solution for shops with lots of customers, as it would become a very long drop down).

But currently this is solved by using the notes buttons (see readme-notes-buttons.txt).

9 Mar 2010, 11:46 AM
#51
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Admin Notes Advanced

paulm:

Uploaded version 0.97

  • Improved notes notifier layout, and the notes notify messages a now grouped by category (especially useful when there a lots of active notes ).

  • To update from 0.96 only overwrite the init_notes_notifier.php file

(Probably) available soon at:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1210
Hi, Great MOd BTW Thanks Paul,

I have 0.951 installed, have error with customer note being assigned to the active customer, so whjatever customer i am editing, all notes are show with that customers ID... rather than faff aboiut, i wish to update to the latest version.

I read in readme.txt for 0.96 warning all notes data will be lost, how can i restore notes from prevoius data from backup ?

Also can i skip 0.96 update and move onto 0.97 and still achieve a working notes system ? and if so, how would i go about restoring the notes data?

Thanks in advance for your attention in this matter.

Kind regards

Jamie

9 Mar 2010, 2:42 PM
#52
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

jamie2k:

I read in readme.txt for 0.96 warning all notes data will be lost, how can i restore notes from prevoius data from backup ?There have been no changes in the installation sql from 0.912 up to 0.97. So you can just replace the files and NOT run the sql when you update to 0.97. And it should be possible to update to 0.97 from any version skipping all version in between.
(if you do run the sql all notes data will be erased though!)

Of course backup first, just to be sure :smile:

9 Mar 2010, 2:55 PM
#53
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Admin Notes Advanced

paulm:

Uploaded version 0.97

  • Improved notes notifier layout, and the notes notify messages a now grouped by category (especially useful when there a lots of active notes ).

  • To update from 0.96 only overwrite the init_notes_notifier.php file

(Probably) available soon at:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1210

paulm:

There have been no changes in the installation sql from 0.912 up to 0.97. So you can just replace the files and NOT run the sql when you update to 0.97. And it should be possible to update to 0.97 from any version skipping all version in between.
(if you do run the sql all notes data will be erased though!)

Of course backup first, just to be sure :smile:

many thnaks :)

1 May 2010, 2:04 AM
#54
rxalex avatar

rxalex

Totally Zenned

Join Date:
Feb 2006
Posts:
588
Plugin Contributions:
0

Re: Admin Notes Advanced

How do I use this to create like a macro message or a generic message for different situations such as back ordered ... We apologize for any inconvenience this may cause... customer service. So I could reuse this message for back order situation and so on...??

19 Oct 2010, 10:40 AM
#55
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,735
Plugin Contributions:
56

Re: Admin Notes Advanced

There's a small bug in this otherwise awesome mod. The define for TEXT_DISPLAY_NUMBER_OF_NOTES should be changed from

define('TEXT_DISPLAY_NUMBER_OF_NOTES', 'Number of notes');

to

define('TEXT_DISPLAY_NUMBER_OF_NOTES', 'Number of notes: <b>%d</b> to <b>%d</b> (of <b>%d</b>)');

(note that the display_count method of the splitPageResults object expects a sprinf style string as its first parameter.)

Thanks to Paulm for making his handiwork available to us all.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

28 Oct 2010, 6:47 PM
#56
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Admin Notes Advanced

I've figured out the code to add the pop up calendar to the edit notes page.
Backup your admin/notes.php before you make any changes so you can put things back if there are any problems!!!

The only file to edit is admin/notes.php as follows:

Line 304:

<body onLoad="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

to:

<body onLoad="init()">
<div id="spiffycalendar" class="text"></div>
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

Line 368:

  case 'edit':
    // $parameters = 
    // ((isset($_GET['cPath'])) ? $_GET['cPath'] : $note->fields['categories_id']) 
    // ((isset($_GET['pID'])) ? '<strong class="notesCheckValue">*</strong>' : '') 
    // ((isset($_GET['oID'])) ? '<strong class="notesCheckValue">*</strong>' : '')
    // ((isset($_GET['cID'])) ? '<strong class="notesCheckValue">*</strong>' : '')

  echo zen_draw_form('edit_note', FILENAME_NOTES, zen_get_all_get_params(array('action')) . '&action=update'); ?>

to:

  case 'edit':
    // $parameters = 
    // ((isset($_GET['cPath'])) ? $_GET['cPath'] : $note->fields['categories_id']) 
    // ((isset($_GET['pID'])) ? '<strong class="notesCheckValue">*</strong>' : '') 
    // ((isset($_GET['oID'])) ? '<strong class="notesCheckValue">*</strong>' : '')
    // ((isset($_GET['cID'])) ? '<strong class="notesCheckValue">*</strong>' : '')
?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script language="JavaScript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<script language="javascript">
  var startDate = new ctlSpiffyCalendarBox("startDate", "edit_note", "notes_start_date","btnDate1","<?php echo $note->fields['notes_start_date']; ?>",scBTNMODE_CUSTOMBLUE);
  var endDate = new ctlSpiffyCalendarBox("endDate", "edit_note", "notes_end_date","btnDate2","<?php echo $note->fields['notes_end_date']; ?>",scBTNMODE_CUSTOMBLUE);
</script>
<?php echo zen_draw_form('edit_note', FILENAME_NOTES, zen_get_all_get_params(array('action')) . '&action=update'); ?>

Line 380:

  <tr><th><?php echo TEXT_INFO_NOTE_START_DATE; ?></th><td><?php echo zen_draw_input_field('notes_start_date', zen_date_short($note->fields['notes_start_date'])); ?></td></tr>
  <tr><th><?php echo TEXT_INFO_NOTE_END_DATE; ?></th><td><?php echo zen_draw_input_field('notes_end_date', zen_date_short($note->fields['notes_end_date'])); ?></td></tr>

to:

  <tr><th><?php echo TEXT_INFO_NOTE_START_DATE; ?></th><td class="main"><script language="javascript">startDate.writeControl(); startDate.dateFormat="yyyy-MM-dd";</script></td></tr>
  <tr><th><?php echo TEXT_INFO_NOTE_END_DATE; ?></th><td class="main"><script language="javascript">endDate.writeControl(); endDate.dateFormat="yyyy-MM-dd";</script></td></tr>

Finally, line 183:

  case 'update':

   $db->Execute("update " . TABLE_NOTES . "
                           SET
                          `notes_status` = '" . zen_db_input(zen_db_prepare_input($_POST['notes_status'])) . "',
                          `notes_title` = '" . zen_db_input(zen_db_prepare_input($_POST['notes_title'])) . "',
                          `notes_text` =  '" . zen_db_input(zen_db_prepare_input($_POST['notes_text'])) . "',
 
                          `notes_start_date` =  '" . zen_db_input(zen_db_prepare_input(zen_date_raw($_POST['notes_start_date']))) . "',                          
                          `notes_end_date` =  '" . zen_db_input(zen_db_prepare_input(zen_date_raw($_POST['notes_end_date']))) . "',
                                                                             
                          `notes_date_modified` = NOW(), 
                          `notes_categories_id` =  '" . (int)$_POST['notes_categories_id'] . "',
                          `notes_priority` =  '" . (int)$_POST['notes_priority'] . "',
                          `notes_is_special_status` =  '" . (int)$_POST['notes_is_special_status'] . "',                              
                          `customers_id` =  '" . (int)$_POST['customers_id'] . "',
                          `orders_id` =  '" . (int)$_POST['orders_id'] . "', 
                          `products_id` =  '" . (int)$_POST['products_id'] . "',
                          `categories_id` =  '" . zen_db_input(zen_db_prepare_input($_POST['categories_id'])) . "' 

                           WHERE notes_id = '" . (int)$_POST['notes_id'] . "'");

to:

  case 'update':

   $db->Execute("update " . TABLE_NOTES . "
                           SET
                          `notes_status` = '" . zen_db_input(zen_db_prepare_input($_POST['notes_status'])) . "',
                          `notes_title` = '" . zen_db_input(zen_db_prepare_input($_POST['notes_title'])) . "',
                          `notes_text` =  '" . zen_db_input(zen_db_prepare_input($_POST['notes_text'])) . "',
 
                          `notes_start_date` =  '" . zen_db_input(zen_db_prepare_input($_POST['notes_start_date'])) . "',                          
                          `notes_end_date` =  '" . zen_db_input(zen_db_prepare_input($_POST['notes_end_date'])) . "',
                                                                             
                          `notes_date_modified` = NOW(), 
                          `notes_categories_id` =  '" . (int)$_POST['notes_categories_id'] . "',
                          `notes_priority` =  '" . (int)$_POST['notes_priority'] . "',
                          `notes_is_special_status` =  '" . (int)$_POST['notes_is_special_status'] . "',                              
                          `customers_id` =  '" . (int)$_POST['customers_id'] . "',
                          `orders_id` =  '" . (int)$_POST['orders_id'] . "', 
                          `products_id` =  '" . (int)$_POST['products_id'] . "',
                          `categories_id` =  '" . zen_db_input(zen_db_prepare_input($_POST['categories_id'])) . "' 

                           WHERE notes_id = '" . (int)$_POST['notes_id'] . "'");
29 Oct 2010, 1:59 PM
#57
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

damiantaylor:

I've figured out the code to add the pop up calendar to the edit notes page.This one was still high on my wishlist. Thanks! :clap:
(installed and it works great)

@swguy: thanks for the fix ::smile:

29 Oct 2010, 4:05 PM
#58
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Admin Notes Advanced

No problem, thanks for the mod it's just what I needed :bigups:

Can I make a suggestion for a future release?
It would be good to store the admin user name on the notes table when a note is created.
That way, you could have a checkbox called 'private' which when checked would only show the note if the same user was logged in.

For example, I have 2 admin users and I'm using admin notes to store my 'to do' list.
I would like said list to only be visible when I am logged in, but at the moment it always appears, regardless of who is logged in.

I hope I've explained that correctly!

3 Nov 2010, 3:59 PM
#59
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

damiantaylor:

It would be good to store the admin user name on the notes table when a note is created.
That way, you could have a checkbox called 'private' which when checked would only show the note if the same user was logged inInteresting idea! I am working on it, but it may take some time before I get the chance to finish it.

5 Nov 2010, 10:44 AM
#60
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Admin Notes Advanced

@damiantaylor: I have a new version including the Private/Public notes functionality, it is not perfect, but it works.

Currently all existing notes will be assigned to one admin (or to none). Maybe I can add some basic functionality to assign each note to it's own admin.

And another issue is that any admin can unset the Public flag of Public notes. After that only the owner can access the note. I am not sure yet how to handle this. Maybe only allow the owner to change the public flag?

And because Public notes can be aditted by anyone, maybe a last edited indicator is needed? Of course it's also possible to only allow editing by the owner.

Improvements are possible but will take time...