home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / modules / addressbook / add_employees.php next >
PHP Script  |  2004-03-08  |  1KB  |  48 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.0 Release date: 08 July 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12. require("../../Group-Office.php");
  13.  
  14. $GO_SECURITY->authenticate();
  15. $GO_MODULES->authenticate('addressbook');
  16.  
  17. require($GO_CONFIG->class_path."addressbook.class.inc");
  18. $ab = new addressbook();
  19.  
  20. if (isset($_REQUEST['company_id']) && $_REQUEST['company_id'] > 0)
  21. {
  22.     if (isset($_REQUEST['clicked_contact']) && $_REQUEST['clicked_contact'] != '')
  23.     {
  24.         $contacts[] = $_REQUEST['clicked_contact'];
  25.     }else
  26.     {
  27.         $contacts = isset($_REQUEST['contacts']) ? $_REQUEST['contacts'] : array();
  28.     }
  29.  
  30.  
  31.     if (isset($contacts))
  32.     {
  33.         for($i=0;$i<sizeof($contacts);$i++)
  34.         {
  35.             $ab->add_contact_to_company($contacts[$i], $_REQUEST['company_id']);
  36.         }
  37.     }
  38. }
  39. ?>
  40. <html>
  41. <body>
  42. <script language="javascript" type="text/javascript">
  43.         opener.document.company_form.submit();
  44.         window.close();
  45. </script>
  46. </body>
  47. </html>
  48.