Ticket #1484923: changelog.diff

File changelog.diff, 12.5 kB (added by ASeques, 6 months ago)

patch with version v0.1.1

  • program/include/rcube_contacts.inc

     
    3434  var $result = null; 
    3535  var $search_fields; 
    3636  var $search_string; 
    37   var $table_cols = array('name', 'email', 'firstname', 'surname'); 
    38    
     37  var $table_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position',  'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice'); 
     38 
    3939  /** public properties */ 
    4040  var $primary_key = 'contact_id'; 
    4141  var $readonly = false; 
     
    156156      $sql_result = $this->db->limitquery( 
    157157        "SELECT * FROM ".$this->db_name." 
    158158         WHERE  del<>1 
    159          AND    user_id=?" . 
     159         AND    (user_id=? OR global_contact = 1)" . 
    160160        ($this->filter ? " AND (".$this->filter.")" : "") . 
    161161        " ORDER BY name", 
    162162        $start_row, 
     
    229229      "SELECT COUNT(contact_id) AS rows 
    230230       FROM ".$this->db_name." 
    231231       WHERE  del<>1 
    232        AND    user_id=?". 
     232       AND    (user_id=? OR global_contact = 1)". 
    233233       ($this->filter ? " AND (".$this->filter.")" : ""), 
    234234      $this->user_id); 
    235235 
     
    264264    $this->db->query( 
    265265      "SELECT * FROM ".$this->db_name." 
    266266       WHERE  contact_id=? 
    267        AND    user_id=? 
     267       AND    (user_id=? OR global_contact = 1) 
    268268       AND    del<>1", 
    269269      $id, 
    270270      $this->user_id); 
     
    355355        "UPDATE ".$this->db_name." 
    356356         SET    changed=".$this->db->now().", ".join(', ', $write_sql)." 
    357357         WHERE  contact_id=? 
    358          AND    user_id=? 
     358         AND    (user_id=? OR global_contact = 1) 
    359359         AND    del<>1", 
    360360        $id, 
    361361        $this->user_id); 
     
    455455} 
    456456 
    457457 
    458 ?> 
    459  No newline at end of file 
     458?> 
  • program/include/main.inc

     
    13281328  { 
    13291329  $fname = '_'.$col; 
    13301330  $attrib['name'] = $fname; 
    1331    
    1332   if ($type=='checkbox') 
     1331 
     1332  if($col == "notice") 
    13331333    { 
     1334        $attrib['rows'] = "8"; 
     1335        $attrib['size'] = "40"; 
     1336        $attrib['cols'] = "40"; 
     1337        $input = new textarea($attrib); 
     1338        } 
     1339  elseif($col == "p_address" | $col == "w_address") 
     1340   { 
     1341        $attrib['rows'] = "4"; 
     1342        $attrib['size'] = "40"; 
     1343        $attrib['cols'] = "40"; 
     1344        $input = new textarea($attrib); 
     1345        } 
     1346  else if ($type=='checkbox')   
     1347    { 
    13341348    $attrib['value'] = '1'; 
    13351349    $input = new checkbox($attrib); 
    13361350    } 
  • program/localization/de_DE/labels.inc

     
    135135$labels['firstname'] = 'Vorname'; 
    136136$labels['surname'] = 'Nachname'; 
    137137$labels['email'] = 'E-Mail'; 
     138$labels['global_contact']   = 'Globaler Kontakt?'; 
     139$labels['firm']     = 'Organisation:'; 
     140$labels['position']     = 'Position:'; 
     141$labels['p_tel']     = 'Telefon:'; 
     142$labels['p_fax']     = 'Fax:'; 
     143$labels['p_mob']     = 'Mobil:'; 
     144$labels['p_address']     = 'Adresse Privat:'; 
     145$labels['w_tel']     = 'Telefon GeschÀftlich:'; 
     146$labels['w_fax']     = 'Fax GeschÀftlich:'; 
     147$labels['w_mob']     = 'Mobil GeschÀftlich:'; 
     148$labels['w_address']     = 'Adresse GeschÀftlich:'; 
     149$labels['notice']     = 'Bemerkung:'; 
    138150$labels['addcontact'] = 'Kontakt hinzufÃŒgen'; 
    139151$labels['editcontact'] = 'Kontakt bearbeiten'; 
    140152$labels['edit'] = 'Bearbeiten'; 
     
    189201$labels['sortasc'] = 'Aufsteigend sortieren'; 
    190202$labels['sortdesc'] = 'Absteigend sortieren'; 
    191203 
    192 ?> 
    193  No newline at end of file 
     204?> 
  • program/localization/ca/labels.inc

     
    136136$labels['firstname'] = 'Nom'; 
    137137$labels['surname'] = 'Cognom'; 
    138138$labels['email'] = 'E-Mail'; 
     139$labels['global_contact']   = 'Contacte Global?'; 
     140$labels['firm']     = 'Organització'; 
     141$labels['position']     = 'Posició'; 
     142$labels['p_tel']     = 'TelÚfon'; 
     143$labels['p_fax']     = 'Fax'; 
     144$labels['p_mob']     = 'Mòbil'; 
     145$labels['p_address']     = 'Adreça'; 
     146$labels['w_tel']     = 'TelÚfon del negoci'; 
     147$labels['w_fax']     = 'Fax del negoci'; 
     148$labels['w_mob']     = 'Mòbil del negoci'; 
     149$labels['w_address']     = 'Direcció comercial'; 
     150$labels['notice']     = 'Avis'; 
    139151$labels['addcontact'] = 'Afegir nou contacte'; 
    140152$labels['editcontact'] = 'Editar contacte'; 
    141153$labels['edit'] = 'Editar'; 
     
    190202$labels['sortasc'] = 'Ordena ascendentment'; 
    191203$labels['sortdesc'] = 'Ordena descendentment'; 
    192204 
    193 ?> 
    194  No newline at end of file 
     205?> 
  • program/localization/es/labels.inc

     
    138138$labels['firstname'] = 'Nombre'; 
    139139$labels['surname'] = 'Apellido'; 
    140140$labels['email'] = 'Correo'; 
     141$labels['global_contact']   = 'Contacto global?'; 
     142$labels['firm']     = 'Organización'; 
     143$labels['position']     = 'Posición'; 
     144$labels['p_tel']     = 'teléfono'; 
     145$labels['p_fax']     = 'Fax'; 
     146$labels['p_mob']     = 'Móvil'; 
     147$labels['p_address']     = 'Dirección'; 
     148$labels['w_tel']     = 'Teléfono del negocio'; 
     149$labels['w_fax']     = 'Fax del negocio'; 
     150$labels['w_mob']     = 'Móvil del negocio'; 
     151$labels['w_address']     = 'Dirección comercial'; 
     152$labels['notice']     = 'Aviso'; 
    141153$labels['addcontact'] = 'Añadir nuevo contacto'; 
    142154$labels['editcontact'] = 'Editar contacto'; 
    143155$labels['edit'] = 'Editar'; 
     
    192204$labels['sortasc'] = 'Orden ascendente'; 
    193205$labels['sortdesc'] = 'Orden descendente'; 
    194206 
    195 ?> 
    196  No newline at end of file 
     207?> 
  • program/localization/en_US/labels.inc

     
    174174$labels['firstname'] = 'First name'; 
    175175$labels['surname']   = 'Last name'; 
    176176$labels['email']     = 'E-Mail'; 
     177$labels['global_contact']   = 'Global Contact?'; 
     178$labels['firm']     = 'Organization:'; 
     179$labels['position']     = 'Position:'; 
     180$labels['p_tel']     = 'Telephone:'; 
     181$labels['p_fax']     = 'Fax:'; 
     182$labels['p_mob']     = 'Mobile:'; 
     183$labels['p_address']     = 'Address:'; 
     184$labels['w_tel']     = 'Business Telephone:'; 
     185$labels['w_fax']     = 'Business Fax:'; 
     186$labels['w_mob']     = 'Business Mobile:'; 
     187$labels['w_address']     = 'Business Address:'; 
     188$labels['notice']     = 'Notes:'; 
    177189 
    178190$labels['addcontact'] = 'Add new contact'; 
    179191$labels['editcontact'] = 'Edit contact'; 
  • program/steps/addressbook/save.inc

     
    3737 
    3838 
    3939// setup some vars we need 
    40 $a_save_cols = array('name', 'firstname', 'surname', 'email'); 
     40$a_save_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position',  'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice'); 
    4141$a_record = array(); 
    4242$cid = get_input_value('_cid', RCUBE_INPUT_POST); 
    4343 
     
    4545foreach ($a_save_cols as $col) 
    4646{ 
    4747  $fname = '_'.$col; 
    48   if (isset($_POST[$fname])) 
     48  if($col == 'global_contact'){ 
     49        if(isset($_POST[$fname])){ 
     50          $a_record[$col] = 1; 
     51        }else{ 
     52          $a_record[$col] = 0; 
     53        } 
     54  }     else if (isset($_POST[$fname])){ 
    4955    $a_record[$col] = get_input_value($fname, RCUBE_INPUT_POST); 
     56  } 
    5057} 
    5158 
    5259// update an existing contact 
  • program/steps/addressbook/show.inc

     
    4343  // return the complete address record as table 
    4444  $out = "<table>\n\n"; 
    4545 
    46   $a_show_cols = array('name', 'firstname', 'surname', 'email'); 
     46# REPLACE with (NOTE: Unfortunately the two labels "Data" and "Contact" are not yet included in the roundcube localization 
     47# file. If someone could help me out on this one I would really appreciate it. As it is for now just translate these two 
     48# labels into your default language. 
     49  $data ="<td width=\"45%\" valign=\"top\">\n<fieldset width=\"45%\" class=\"title\"><legend><b>Data</b></legend><table>\n\n"; 
     50  $contact ="<td width=\"45%\" valign=\"top\">\n<fieldset width=\"45%\" class=\"title\"><legend><b>Contact</b></legend><table>\n\n"; 
     51 
     52  $a_show_cols = array('name', 'firstname', 'surname', 'email', 'global_contact', 'firm', 'position',  'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice'); 
    4753  foreach ($a_show_cols as $col) 
    4854    { 
    4955    if ($col=='email' && !empty($record[$col])) 
     
    5662    else 
    5763      $value = Q($record[$col]); 
    5864     
    59     $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n", 
    60                     Q(rcube_label($col)), 
    61                     $value); 
     65       $title = Q(rcube_label($col)); 
     66        if($col == "notice"){ 
     67                $out2 = "<td colspan=\"3\" width=\"100%\" valign=\"top\"><fieldset width=\"100%\" class=\"title\"><legend><b>$title</b></legend><table>\n"; 
     68                $out2 .= sprintf("<tr><td>%s</td></tr>\n", $value); 
     69                $out2 .= "</table></fieldset></td>\n\n"; 
     70        } 
     71        elseif($col == "p_tel" | $col == "p_fax" | $col == "p_mob" | $col == "w_tel" | $col == "w_fax" | $col == "w_mob"){ 
     72                if(!$value == ""){ 
     73                $contact .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, $value); 
     74                } 
     75        } 
     76        elseif($col == "p_address"){ 
     77                $p_address = "<td width=\"45%\" valign=\"top\"><fieldset width=\"45%\" class=\"title\"><legend><b>$title</b></legend><table>\n"; 
     78                $p_address .= sprintf("<tr><td>%s</td></tr>\n", $value); 
     79                $p_address .= "</table></fieldset></td>\n\n"; 
     80        } 
     81        elseif($col == "w_address"){ 
     82                $w_address = "<td width=\"45%\" valign=\"top\"><fieldset width=\"45%\" class=\"title\"><legend><b>$title</b></legend><table>\n"; 
     83                $w_address .= sprintf("<tr><td>%s</td></tr>\n", $value); 
     84                $w_address .= "</table></fieldset></td>\n\n"; 
     85        } 
     86        else{ 
     87                if($col == "global_contact"){ 
     88                        if($value == 1) 
     89                          $data .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, '&#10004;'); 
     90                        else 
     91                          $data .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, '&#10008;'); 
     92                } else if(!$value == "") 
     93                  $data .= sprintf("<tr><td>%s</td><td>%s</td></tr>\n",$title, $value); 
     94        } 
     95 
     96 
     97 
    6298    } 
    63    
    64   $out .= "\n</table>"; 
    65    
     99        $data .= "</table></td>"; 
     100        $contact .= "</table></td>"; 
     101 
     102  $out .= "$data<td width=\"2%\">$contact\n\n"; 
     103  $out .= "</tr><tr>"; 
     104  $out .= "$p_address<td width=\"2%\">$w_address\n\n"; 
     105  $out .= "</tr><tr>"; 
     106  $out .= $out2; 
     107  $out .= "\n</tr></table>";  
    66108  return $out;   
    67109  } 
    68110 
     
    70112//$OUTPUT->framed = $_framed; 
    71113$OUTPUT->add_handler('contactdetails', 'rcmail_contact_details'); 
    72114$OUTPUT->send('showcontact'); 
    73 ?> 
    74  No newline at end of file 
     115?> 
  • program/steps/addressbook/edit.inc

     
    6161  // return the complete address edit form as table 
    6262  $out = "$form_start<table>\n\n"; 
    6363 
    64   $a_show_cols = array('name', 'firstname', 'surname', 'email'); 
     64  $a_show_cols = array('name', 'firstname', 'surname', 'global_contact', 'email', 'firm', 'position',  'p_tel', 'p_fax', 'p_mob', 'p_address', 'w_tel', 'w_fax', 'w_mob', 'w_address', 'notice'); 
    6565  foreach ($a_show_cols as $col) 
    6666  { 
    67     $attrib['id'] = 'rcmfd_'.$col; 
     67    if($col == "global_contact") 
     68      $value = rcmail_get_edit_field($col, $record[$col], $attrib, 'checkbox'); 
     69    else 
    6870    $value = rcmail_get_edit_field($col, $record[$col], $attrib); 
    6971    $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n", 
    7072                    $attrib['id'], 
     
    118120 
    119121// this will be executed if no template for addcontact exists 
    120122parse_template('editcontact'); 
    121 ?> 
    122  No newline at end of file 
     123?>