Fixes for jpegPhoto attributes during copy operations

This commit is contained in:
Deon George 2011-04-28 23:20:06 +10:00
parent db241f1c98
commit 1f9308dc4d
4 changed files with 16 additions and 10 deletions

View File

@ -187,9 +187,9 @@ if (count($request['template']->getLDAPmodify(true))) {
echo '<div style="text-align: center;">'; echo '<div style="text-align: center;">';
echo '<br />'; echo '<br />';
printf('<input type="submit" value="%s" %s/>', // @todo cant use AJAX here, it affects file uploads.
_('Commit'), printf('<input type="submit" value="%s" />',
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'update_form\'),\'%s\');"',_('Updating Object')) : '')); _('Update Object'));
printf('<input type="submit" name="cancel" value="%s" %s/>', printf('<input type="submit" name="cancel" value="%s" %s/>',
_('Cancel'), _('Cancel'),

View File

@ -836,7 +836,10 @@ class PageRender extends Visitor {
} }
protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) { protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) {
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false); $this->draw('HiddenValue',$attribute,$i);
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
} }
protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) { protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) {

View File

@ -708,6 +708,10 @@ class Template extends xmlTemplate {
} }
} }
} }
// @todo If this is a Jpeg Attribute, we need to mark it read only, since it cant be deleted like text attributes can
if (strcasecmp(get_class($attribute),'jpegAttribute') == 0)
$attribute->setReadOnly();
} }
# If we have any RDN values left over, there werent in the original entry and need to be added. # If we have any RDN values left over, there werent in the original entry and need to be added.

View File

@ -1444,9 +1444,8 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__); if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
if (! $this->template->isReadOnly()) if (! $this->template->isReadOnly())
printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" %s/></td></tr>', // @todo cant use AJAX here, it affects file uploads.
_('Update Object'), printf('<tr><td colspan="2" style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td></tr>',
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'entry_form\'),\'%s\');"',_('Updating DN')) : ''),
_('Update Object')); _('Update Object'));
} }
@ -1546,9 +1545,9 @@ class TemplateRender extends PageRender {
if ($page < $this->pagelast) if ($page < $this->pagelast)
printf('<td>&nbsp;</td><td><input type="submit" id="create_button" value="%s" /></td>',_('Proceed &gt;&gt;')); printf('<td>&nbsp;</td><td><input type="submit" id="create_button" value="%s" /></td>',_('Proceed &gt;&gt;'));
else else
printf('<td style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" %s /></td>', // @todo cant use AJAX here, it affects file uploads.
_('Create Object'), printf('<td style="text-align: center;"><input type="submit" id="create_button" name="submit" value="%s" /></td>',
(isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'entry_form\'),\'%s\');"',_('Creating Object')) : '')); _('Create Object'));
echo '</tr>'; echo '</tr>';
} }