Merge branch 'master' into calendar_repeat

This commit is contained in:
Georg Ehrke 2012-06-16 19:04:50 +02:00
commit 7f1e0287a9
9 changed files with 34 additions and 25 deletions

View File

@ -80,6 +80,7 @@ class MDB2_Schema_Writer
function __construct($valid_types = array()) function __construct($valid_types = array())
{ {
$this->valid_types = $valid_types; $this->valid_types = $valid_types;
}
// }}} // }}}
// {{{ raiseError() // {{{ raiseError()

View File

@ -13,7 +13,7 @@ OCP\JSON::checkAppEnabled('contacts');
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
$contacts = OC_Contacts_VCard::all($ids); $contacts = OC_Contacts_VCard::all($ids);
$tmpl = new OCP\Template("contacts", "part.contacts"); $tmpl = new OCP\Template("contacts", "part.contacts");
$tmpl->assign('contacts', $contacts); $tmpl->assign('contacts', $contacts, false);
$page = $tmpl->fetchPage(); $page = $tmpl->fetchPage();
OCP\JSON::success(array('data' => array( 'page' => $page ))); OCP\JSON::success(array('data' => array( 'page' => $page )));

View File

@ -20,7 +20,18 @@ if($checksum) {
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
$element = $vcard->children[$line]; $element = $vcard->children[$line];
$adr = OC_Contacts_VCard::structureProperty($element); $adr = OC_Contacts_VCard::structureProperty($element);
$tmpl->assign('adr',$adr); $types = array();
if(isset($adr['parameters']['TYPE'])) {
if(is_array($adr['parameters']['TYPE'])) {
$types = array_map('htmlspecialchars', $adr['parameters']['TYPE']);
$types = array_map('strtoupper', $types);
} else {
$types = array(strtoupper(htmlspecialchars($adr['parameters']['TYPE'])));
}
}
$tmpl->assign('types', $types, false);
$adr = array_map('htmlspecialchars', $adr['value']);
$tmpl->assign('adr', $adr, false);
} }
$tmpl->assign('id',$id); $tmpl->assign('id',$id);

View File

@ -28,8 +28,9 @@ if($id) {
$name = OC_Contacts_VCard::structureProperty($property); $name = OC_Contacts_VCard::structureProperty($property);
} }
} }
$tmpl->assign('name',$name); $name = array_map('htmlspecialchars', $name['value']);
$tmpl->assign('id',$id); $tmpl->assign('name',$name, false);
$tmpl->assign('id',$id, false);
} else { } else {
bailOut(OC_Contacts_App::$l10n->t('Contact ID is missing.')); bailOut(OC_Contacts_App::$l10n->t('Contact ID is missing.'));
} }

View File

@ -66,7 +66,7 @@ $tmpl->assign('phone_types', $phone_types);
$tmpl->assign('email_types', $email_types); $tmpl->assign('email_types', $email_types);
$tmpl->assign('categories', $categories); $tmpl->assign('categories', $categories);
$tmpl->assign('addressbooks', $addressbooks); $tmpl->assign('addressbooks', $addressbooks);
$tmpl->assign('contacts', $contacts); $tmpl->assign('contacts', $contacts, false);
$tmpl->assign('details', $details ); $tmpl->assign('details', $details );
$tmpl->assign('id',$id); $tmpl->assign('id',$id);
$tmpl->printPage(); $tmpl->printPage();

View File

@ -8,5 +8,5 @@
} }
} }
?> ?>
<li role="button" book-id="<?php echo $contact['addressbookid']; ?>" data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $display; ?></a></li> <li role="button" book-id="<?php echo $contact['addressbookid']; ?>" data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo htmlspecialchars($display); ?></a></li>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -1,13 +1,9 @@
<?php <?php
$adr = isset($_['adr'])?$_['adr']:array(); $adr = isset($_['adr'])?$_['adr']:array();
$id = $_['id']; $id = isset($_['id'])?$_['id']:array();
$types = array(); $types = isset($_['types'])?$_['types']:array();
foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):array() as $type) {
$types[] = strtoupper($type);
}
?> ?>
<div id="edit_address_dialog" title="<?php echo $l->t('Edit address'); ?>"> <div id="edit_address_dialog" title="<?php echo $l->t('Edit address'); ?>">
<!-- ?php print_r($types); ? -->
<fieldset id="address"> <fieldset id="address">
<dl class="form"> <dl class="form">
<dt> <dt>
@ -22,43 +18,43 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
<label class="label" for="adr_pobox"><?php echo $l->t('PO Box'); ?></label> <label class="label" for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_pobox" name="value[ADR][0]" placeholder="<?php echo $l->t('PO Box'); ?>" value="<?php echo isset($adr['value'][0])?$adr['value'][0]:''; ?>"> <input type="text" id="adr_pobox" name="value[ADR][0]" placeholder="<?php echo $l->t('PO Box'); ?>" value="<?php echo isset($adr[0])?$adr[0]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_street"><?php echo $l->t('Street address'); ?></label> <label class="label" for="adr_street"><?php echo $l->t('Street address'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_street" name="value[ADR][2]" placeholder="<?php echo $l->t('Street and number'); ?>" value="<?php echo isset($adr['value'][2])?$adr['value'][2]:''; ?>"> <input type="text" id="adr_street" name="value[ADR][2]" placeholder="<?php echo $l->t('Street and number'); ?>" value="<?php echo isset($adr[2])?$adr[2]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label> <label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_extended" name="value[ADR][1]" placeholder="<?php echo $l->t('Apartment number etc.'); ?>" value="<?php echo isset($adr['value'][1])?$adr['value'][1]:''; ?>"> <input type="text" id="adr_extended" name="value[ADR][1]" placeholder="<?php echo $l->t('Apartment number etc.'); ?>" value="<?php echo isset($adr[1])?$adr[1]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label> <label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_city" name="value[ADR][3]" placeholder="<?php echo $l->t('City'); ?>" value="<?php echo isset($adr['value'][3])?$adr['value'][3]:''; ?>"> <input type="text" id="adr_city" name="value[ADR][3]" placeholder="<?php echo $l->t('City'); ?>" value="<?php echo isset($adr[3])?$adr[3]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label> <label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_region" name="value[ADR][4]" placeholder="<?php echo $l->t('E.g. state or province'); ?>" value="<?php echo isset($adr['value'][4])?$adr['value'][4]:''; ?>"> <input type="text" id="adr_region" name="value[ADR][4]" placeholder="<?php echo $l->t('E.g. state or province'); ?>" value="<?php echo isset($adr[4])?$adr[4]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label> <label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_zipcode" name="value[ADR][5]" placeholder="<?php echo $l->t('Postal code'); ?>" value="<?php echo isset($adr['value'][5])?$adr['value'][5]:''; ?>"> <input type="text" id="adr_zipcode" name="value[ADR][5]" placeholder="<?php echo $l->t('Postal code'); ?>" value="<?php echo isset($adr[5])?$adr[5]:''; ?>">
</dd> </dd>
<dt> <dt>
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label> <label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
</dt> </dt>
<dd> <dd>
<input type="text" id="adr_country" name="value[ADR][6]" placeholder="<?php echo $l->t('Country'); ?>" value="<?php echo isset($adr['value'][6])?$adr['value'][6]:''; ?>"> <input type="text" id="adr_country" name="value[ADR][6]" placeholder="<?php echo $l->t('Country'); ?>" value="<?php echo isset($adr[6])?$adr[6]:''; ?>">
</dd> </dd>
</dl> </dl>
</fieldset> </fieldset>

View File

@ -22,7 +22,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null;
<?php }} ?> <?php }} ?>
<dt><label for="pre"><?php echo $l->t('Hon. prefixes'); ?></label></dt> <dt><label for="pre"><?php echo $l->t('Hon. prefixes'); ?></label></dt>
<dd> <dd>
<input name="pre" id="pre" value="<?php echo isset($name['value'][3]) ? $name['value'][3] : ''; ?>" type="text" list="prefixes" /> <input name="pre" id="pre" value="<?php echo isset($name[3]) ? $name[3] : ''; ?>" type="text" list="prefixes" />
<datalist id="prefixes"> <datalist id="prefixes">
<option value="<?php echo $l->t('Miss'); ?>"> <option value="<?php echo $l->t('Miss'); ?>">
<option value="<?php echo $l->t('Ms'); ?>"> <option value="<?php echo $l->t('Ms'); ?>">
@ -33,14 +33,14 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null;
</datalist> </datalist>
</dd> </dd>
<dt><label for="giv"><?php echo $l->t('Given name'); ?></label></dt> <dt><label for="giv"><?php echo $l->t('Given name'); ?></label></dt>
<dd><input name="giv" id="giv" value="<?php echo isset($name['value'][1]) ? $name['value'][1] : ''; ?>" type="text" /></dd> <dd><input name="giv" id="giv" value="<?php echo isset($name[1]) ? $name[1] : ''; ?>" type="text" /></dd>
<dt><label for="add"><?php echo $l->t('Additional names'); ?></label></dt> <dt><label for="add"><?php echo $l->t('Additional names'); ?></label></dt>
<dd><input name="add" id="add" value="<?php echo isset($name['value'][2]) ? $name['value'][2] : ''; ?>" type="text" /></dd> <dd><input name="add" id="add" value="<?php echo isset($name[2]) ? $name[2] : ''; ?>" type="text" /></dd>
<dt><label for="fam"><?php echo $l->t('Family name'); ?></label></dt> <dt><label for="fam"><?php echo $l->t('Family name'); ?></label></dt>
<dd><input name="fam" id="fam" value="<?php echo isset($name['value'][0]) ? $name['value'][0] : ''; ?>" type="text" /></dd> <dd><input name="fam" id="fam" value="<?php echo isset($name[0]) ? $name[0] : ''; ?>" type="text" /></dd>
<dt><label for="suf"><?php echo $l->t('Hon. suffixes'); ?></label></dt> <dt><label for="suf"><?php echo $l->t('Hon. suffixes'); ?></label></dt>
<dd> <dd>
<input name="suf" id="suf" value="<?php echo isset($name['value'][4]) ? $name['value'][4] : ''; ?>" type="text" list="suffixes" /> <input name="suf" id="suf" value="<?php echo isset($name[4]) ? $name[4] : ''; ?>" type="text" list="suffixes" />
<datalist id="suffixes"> <datalist id="suffixes">
<option value="<?php echo $l->t('J.D.'); ?>"> <option value="<?php echo $l->t('J.D.'); ?>">
<option value="<?php echo $l->t('M.D.'); ?>"> <option value="<?php echo $l->t('M.D.'); ?>">

View File

@ -22,7 +22,7 @@ function viewImage(dir, file) {
if(file.indexOf('.psd')>0){//can't view those if(file.indexOf('.psd')>0){//can't view those
return; return;
} }
var location=OC.filePath('files','ajax','download.php')+'?files='+encodeURIComponent(file)+'&dir='+encodeURIComponent(dir); var location=OC.filePath('files','ajax','download.php')+encodeURIComponent('?files='+encodeURIComponent(file)+'&dir='+encodeURIComponent(dir));
$.fancybox({ $.fancybox({
"href": location, "href": location,
"title": file.replace(/</, "&lt;").replace(/>/, "&gt;"), "title": file.replace(/</, "&lt;").replace(/>/, "&gt;"),