Skip to content

Commit

Permalink
Merge pull request #1601 from rallek/release-1.3
Browse files Browse the repository at this point in the history
This PR was merged into zikula:release-1.3 branch.

Discussion
----------

adding my 1.3.6patch repro

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | 
| Refs tickets  | 
| License       | MIT
| Doc PR        | 

this will close my collection at https://github.com/rallek/1.3.6patch

Commits
-------

be16503 workflow fix

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  | #704
| License       | MIT
| Doc PR        | rallek
3d081c9 drag and drop fix for extmenu

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  | #924
| License       | MIT
| Doc PR        |

see also https://gist.github.com/cmfcmf/6329308 rallek
6715748 Fixed Block filtering in 1.3.5/6

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  | #516, #938
| License       | MIT
| Doc PR        | rallek
2ca1a5b Fixed displaying of selection boxes

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #762
| Refs tickets  | #775
| License       | MIT
| Doc PR        | rallek
64f0cd8 added jpeg

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  | #783
| License       | MIT
| Doc PR        | rallek
a2b3e3a Avoid flush by category selector

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  | #1561
| License       | MIT
| Doc PR        | rallek
dd0036b some more fixes

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Refs tickets  |
| License       | MIT
| Doc PR        |

do not know the tickets of this fixes rallek
2f519ce Update users_user_login.tpl

``|safetext`` added rallek
966e29b Update users_block_login.tpl

``|safetext`` added rallek
b05529e Update CategorySelector.php

``public `` added
thanks to cmf! rallek
20383d0 Update PageUtil.php

Korinthen for cmf ;-) rallek
  • Loading branch information
Drak committed Feb 12, 2014
2 parents 709f36b + 20383d0 commit 79d8c78
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 465 deletions.
40 changes: 24 additions & 16 deletions src/lib/Zikula/Form/Plugin/CategorySelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static function loadParameters(&$list, $includeEmptyElement, $params)
/**
* Load event handler.
*
* @param Zikula_Form_View $view Reference to Form render object.
* @param Zikula_Form_View $view Reference to Form render object.
* @param array &$params Parameters passed from the Smarty plugin function.
*
* @return void
Expand Down Expand Up @@ -204,7 +204,7 @@ public function render(Zikula_Form_View $view)
* Called by the render when doing $render->getValues()
* Uses the group parameter to decide where to store data.
*
* @param Zikula_Form_View $view Reference to Form render object.
* @param Zikula_Form_View $view Reference to Form render object.
* @param array &$data Data object.
*
* @return void
Expand All @@ -220,7 +220,7 @@ public function saveValue(Zikula_Form_View $view, &$data)
}
$data[$this->group]['__CATEGORIES__'][$this->dataField] = $this->getSelectedValue();
}
} elseif ($this->enableDoctrine && $this->dataBased) {
} else if ($this->enableDoctrine && $this->dataBased) {
if ($this->group == null) {
$data['Categories'][$this->dataField] = array('category_id' => $this->getSelectedValue(),
'reg_property' => $this->dataField);
Expand All @@ -231,7 +231,7 @@ public function saveValue(Zikula_Form_View $view, &$data)
$data[$this->group]['Categories'][$this->dataField] = array('category_id' => $this->getSelectedValue(),
'reg_property' => $this->dataField);
}
} elseif ($this->doctrine2) {
} else if ($this->doctrine2) {
$entity = $view->get_template_vars($this->group);

// load category from db
Expand All @@ -247,21 +247,29 @@ public function saveValue(Zikula_Form_View $view, &$data)
}


if (is_array($this->getSelectedValue())) {
if(is_array($this->getSelectedValue())) {
$selectedValues = $this->getSelectedValue();
} else {
$selectedValues[] = $this->getSelectedValue();
}
$selectedValues = array_combine($selectedValues, $selectedValues);

foreach ($collection->getKeys() as $key) {
$categoryId = $collection->get($key)->getCategoryRegistryId();
if ($categoryId == $this->registryId) {
$collection->remove($key);
}
}
foreach ($collection->getKeys() as $key) {
$entityCategory = $collection->get($key);

if ($entityCategory->getCategoryRegistryId() == $this->registryId) {
$categoryId = $entityCategory->getCategory()->getId();

$em->flush();
if (isset($selectedValues[$categoryId])) {
unset($selectedValues[$categoryId]);
} else {
$collection->remove($key);
}
}
}

// we do NOT flush here, as the calling module is responsible for that (Guite)
//$em->flush();

foreach ($selectedValues as $selectedValue) {

Expand All @@ -280,7 +288,7 @@ public function saveValue(Zikula_Form_View $view, &$data)
* Called internally by the plugin itself to load values from the render.
* Can also by called when some one is calling the render object's Zikula_Form_View::setValues.
*
* @param Zikula_Form_View $view Reference to Zikula_Form_View render object.
* @param Zikula_Form_View $view Reference to Zikula_Form_View render object.
* @param array &$values Values to load.
*
* @return void
Expand Down Expand Up @@ -316,7 +324,7 @@ public function loadValue(Zikula_Form_View $view, &$values)

$this->setSelectedValue($value);

} elseif ($this->enableDoctrine && $this->dataBased) {
} else if ($this->enableDoctrine && $this->dataBased) {
$items = null;
$value = null;

Expand Down Expand Up @@ -345,13 +353,13 @@ public function loadValue(Zikula_Form_View $view, &$values)

$this->setSelectedValue($value);

} elseif ($this->doctrine2) {
} else if ($this->doctrine2) {
if (isset($values[$this->group])) {
$entity = $values[$this->group];
if (isset($entity[$this->dataField])) {
$collection = $entity[$this->dataField];
$selectedValues = array();
foreach ($collection as $c) {
foreach($collection as $c) {
$categoryId = $c->getCategoryRegistryId();
if ($categoryId == $this->registryId) {
$selectedValues[] = $c->getCategory()->getId();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Zikula/Form/Plugin/DateInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function render(Zikula_Form_View $view)

$i18n = ZI18n::getInstance();

if (!empty($this->defaultValue) && !$view->isPostBack() && empty($this->text)) {
if (!empty($this->defaultValue) && !$view->isPostBack()) {
$d = strtolower($this->defaultValue);
$now = getdate();
$date = null;
Expand Down
6 changes: 4 additions & 2 deletions src/lib/Zikula/Workflow/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ public static function getActionsForObject(&$obj, $dbTable, $idcolumn = 'id', $m
$module = ModUtil::getName();
}

if (!self::getWorkflowForObject($obj, $dbTable, $idcolumn, $module)) {
return false;
if (!isset($obj['__WORKFLOW__'])) {
if (!self::getWorkflowForObject($obj, $dbTable, $idcolumn, $module)) {
return false;
}
}

$workflow = $obj['__WORKFLOW__'];
Expand Down
12 changes: 8 additions & 4 deletions src/lib/util/BlockUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public static function displayPosition($side, $echo = true, $implode = true)
}

if (!isset($modname)) {
$modname = FormUtil::getPassedValue('module', '_homepage_', 'GETPOST', FILTER_SANITIZE_STRING);
if (PageUtil::isHomepage()) {
$modname = '_homepage_';
} else {
$modname = ModUtil::getName();
}
}

// get all block placements
Expand Down Expand Up @@ -119,9 +123,9 @@ public static function displayPosition($side, $echo = true, $implode = true)
continue;
}

$rule1 = $filter['module'] == $modname;
$rule2 = empty($filter['ftype']) ? true : ($filter['ftype'] == $type);
$rule3 = empty($filter['fname']) ? true : ($filter['fname'] == $func);
$rule1 = strtolower($filter['module']) == strtolower($modname);
$rule2 = empty($filter['ftype']) ? true : (strtolower($filter['ftype']) == strtolower($type));
$rule3 = empty($filter['fname']) ? true : (strtolower($filter['fname']) == strtolower($func));

if (empty($filter['fargs'])) {
$rule4 = true;
Expand Down
15 changes: 15 additions & 0 deletions src/lib/util/PageUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,5 +346,20 @@ public static function addVar($varname, $value)

return true;
}

/**
* Check if the current page is the homepage.
*
* @return boolean true If it is the homepage, false if it is not the homepage.
*/
public static function isHomepage()
{
$moduleGetName = FormUtil::getPassedValue('module', null, 'GETPOST', FILTER_SANITIZE_STRING);
if (empty($moduleGetName)) {
return true;
} else {
return false;
}
}

}
3 changes: 1 addition & 2 deletions src/style/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ table.z-admintable ul li {
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#dfdfdf)); /*webkit*/
-webkit-border-radius: 3px;
}

.z-form .z-formrow select optgroup {
font-style: normal;
font-weight: bold;
Expand Down Expand Up @@ -536,7 +535,7 @@ button.z-imagebutton, /* Buttons in inline 'ajax' forms */
padding: 0.3em 2px 0.3em 1px;
cursor: pointer;
width: 68.6%;
display: block;
display: inline-block;
position: relative;
}

Expand Down
Loading

0 comments on commit 79d8c78

Please sign in to comment.