Fixed links in scheduling tool to point to "add" ability
[eq/.git] / inc / class.eq.inc.php
index 8802e7565f413db6ea75cbcb1a02e27727112fd9..7a2950416231f125f6c025c7a278d52da475cebd 100644 (file)
@@ -1033,6 +1033,14 @@ class eq
            $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " AND eqpresppi=1 ORDER BY date DESC";
            $this->db->query($sql,__LINE__,__FILE__);
            if($this->db->next_record()) { $date = $this->db->f('date'); } else { $date = ""; }
+           $link_data['menuaction'] = 'eq.eq.ppi_update';
+           $link_data['elder'] = $id;
+           $link_data['aaronic'] = 0;
+           $link_data['name'] = $name;
+           $link_data['ppi'] = '';
+           $link_data['eqpresppi'] = 1;
+           $link_data['action'] = 'add';
+           $link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data);
            $table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name</a></td>";
            $table_data.= "<td align=center>$phone</td>";
            //$table_data.= "<td align=center>$ppi_pri</td>";
@@ -1191,7 +1199,7 @@ class eq
       $appt_table_data = ""; 
 
       // create the family id -> family name mapping
-      $sql = "SELECT * FROM eq_family where valid=1 and companionship != 0 ORDER BY name ASC";
+      $sql = "SELECT * FROM eq_family where valid=1 and elder_id != 0 ORDER BY name ASC";
       $this->db->query($sql,__LINE__,__FILE__);
       $i=0;
       $family_id = NULL;
@@ -1247,7 +1255,7 @@ class eq
 
       
       // VISIT SCHEDULING TABLE
-      $sql = "SELECT * FROM eq_family where valid=1 and companionship != 0 ORDER BY visit_pri ASC";
+      $sql = "SELECT * FROM eq_family where valid=1 and elder_id != 0 ORDER BY visit_pri ASC";
       $this->db->query($sql,__LINE__,__FILE__);
 
       $total_families=0; $families_with_yearly_visit=0;
@@ -1297,6 +1305,12 @@ class eq
            $sql = "SELECT * FROM eq_visit WHERE family=" . $id . " AND companionship=0 ORDER BY date DESC";
            $this->db->query($sql,__LINE__,__FILE__);
            if($this->db->next_record()) { $date = $this->db->f('date'); } else { $date = ""; }
+           $link_data['menuaction'] = 'eq.eq.vis_update';
+           $link_data['visit'] = '';
+           $link_data['family'] = $id;
+           $link_data['name'] = $name;
+           $link_data['action'] = 'add';
+           $link = $GLOBALS['phpgw']->link('/eq/index.php',$link_data);
            $table_data.= "<tr bgcolor=". $this->t->get_var('tr_color') ."><td title=\"$phone\"><a href=$link>$name Family</a></td>";
            $table_data.= "<td align=center>$phone</td>";
            $table_data.= "<td align=center>";
@@ -2496,7 +2510,7 @@ class eq
        }
       array_multisort($elder_name, $elder_id);
 
-      $sql = "SELECT * FROM eq_family where valid=1 and companionship != 0 ORDER BY name ASC";
+      $sql = "SELECT * FROM eq_family where valid=1 and elder_id != 0 ORDER BY name ASC";
       $this->db->query($sql,__LINE__,__FILE__);
       $i=0;
       while ($this->db->next_record())
@@ -2680,7 +2694,10 @@ class eq
        {        
          $target_path = $this->upload_target_path . basename( $_FILES['uploadedfile']['name']);
          
-         if((($_FILES['uploadedfile']['type'] == "application/zip") || ($_FILES['uploadedfile']['type'] == "application/x-zip-compressed")) &&
+         if((($_FILES['uploadedfile']['type'] == "application/zip") ||
+             ($_FILES['uploadedfile']['type'] == "application/x-zip-compressed") ||
+             ($_FILES['uploadedfile']['type'] == "application/x-zip") ||
+             ($_FILES['uploadedfile']['type'] == "application/octet-stream")) &&
             (move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))) {
            $uploadstatus = "<b>The following file was uploaded successfully: </b><br><br>";
            $uploadstatus.= "Filename : " . $_FILES['uploadedfile']['name'] . "<br>";
@@ -2762,7 +2779,9 @@ class eq
            print "</pre></td></tr></table>";
            
          } else if(($_FILES['uploadedfile']['type'] != "application/zip") &&
-                   ($_FILES['uploadedfile']['type'] != "application/x-zip-compressed")) {
+                   ($_FILES['uploadedfile']['type'] != "application/x-zip-compressed") &&
+                   ($_FILES['uploadedfile']['type'] != "application/x-zip") &&
+                   ($_FILES['uploadedfile']['type'] != "application/octet-stream")) {
            $uploadstatus = "<b><font color=red>The file format must be a .zip file, please try again! </font></b>";
            $uploadstatus.= "<br><br><b>Detected file format: " . $_FILES['uploadedfile']['type'] . "</b>";
            $this->t->set_var('uploadstatus',$uploadstatus);