Commit bdaa8c24 by netz.coop

GPL

0 parents
Showing with 5131 additions and 0 deletions
/**
* @category freeSN
* @mailto code [at] netz.coop
* @version 0.4.200901
* @link http://netz.coop
*
* @copyright Copyright by netz.coop e.G. 2015
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
\ No newline at end of file
ln -s /var/www/Magento/AncLib/app/design/adminhtml/layout/lib.xml /var/www/Magento/Magento19/app/design/adminhtml/default/default/layout/anc/
\ No newline at end of file
Magento Extension ist abhängig von weiteren Extensions!
select "-- AncLib lösche Datenbank Tabellen";
select "-- lösche mag_core_resource / anc_lib_setup";
DELETE FROM `mag_core_resource` WHERE `mag_core_resource`.`code` = 'anc_lib_setup';
select "-- lösche mag_anc_lib_timetable";
DROP TABLE mag_anc_lib_timetable;
select "-- lösche mag_anc_lib_ncrights";
DROP TABLE mag_anc_lib_ncrights
select "-- lösche mag_anc_lib_ncrightscustomers";
DROP TABLE mag_anc_lib_ncrightscustomers
select "-- lösche mag_anc_lib_ncrightsgroups";
DROP TABLE mag_anc_lib_ncrightsgroups
\ No newline at end of file
#!/bin/bash
APPBASE="Anc"
APPNAME="Lib"
APPBASELC="anc"
APPNAMELC="lib"
APPDIR="/var/www/$2/${APPBASE}${APPNAME}"
echo "############"
echo "###########"
echo "########## ${APPBASE}${APPNAME} SETUP SCRIPT"
####
#
#
##
if [ "$3" = "TRUE" ];then
echo '*** !!! ACHTUNG NEWINSTALL = TRUE Datenbanken und Verzeichnisse der ${APPBASE}${APPNAME} werden gelöscht'
# CODE
echo "Lösche: rm -R $1/app/code/local/${APPBASE}/${APPNAME}"
rm -R "$1/app/code/local/${APPBASE}/${APPNAME}"
#ETC
echo "Lösche: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
rm -R "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
exit 0
fi
###
# Code Local
#
##
if [ ! -d "$1/app/code/local/${APPBASE}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/code/local/${APPBASE}"
mkdir "$1/app/code/local/${APPBASE}"
fi
if [ ! -d "$1/app/code/local/${APPBASE}/${APPNAME}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}"
ln -s $APPDIR/app/code/local/${APPBASE}/${APPNAME} $1/app/code/local/${APPBASE}/${APPNAME}
fi
###
# etc
#
##
if [ ! -f "$1/app/etc/modules/${APPBASE}_${APPNAME}.xml" ];then
echo "*** Verlinke Datei: $1/app/etc/modules/${APPBASE}_${APPNAME}.xml"
ln -s $APPDIR/app/etc/modules/${APPBASE}_${APPNAME}.xml $1/app/etc/modules/${APPBASE}_${APPNAME}.xml
fi
###
# Design Frontend
#
##
if [ ! -d "$1/app/design/frontend/base/default/template" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template"
mkdir "$1/app/design/frontend/base/default/template"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/app/design/frontend/base/default/template/${APPBASELC}"
mkdir "$1/app/design/frontend/base/default/template/${APPBASELC}"
fi
if [ ! -d "$1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Datei: $APPDIR/app/design/frontend/template/${APPBASELC}/${APPNAMELC} $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/app/design/frontend/template $1/app/design/frontend/base/default/template/${APPBASELC}/${APPNAMELC}
fi
###
# js
#
##
if [ ! -d "$1/js/${APPBASE}" ];then
echo "*** Erstelle das Verzeichniss: $1/js/${APPBASE}"
mkdir "$1/js/${APPBASE}"
fi
if [ ! -d "$1/js/${APPBASE}/${APPNAME}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/js $1/js/${APPBASE}/${APPNAME}"
ln -s $APPDIR/js $1/js/${APPBASE}/${APPNAME}
fi
###
# skin
#
##
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}" ];then
echo "*** Erstelle das Verzeichniss: $1/skin/frontend/base/default/css/${APPBASELC}"
mkdir "$1/skin/frontend/base/default/css/${APPBASELC}"
fi
if [ ! -d "$1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}" ];then
echo "*** Verlinke Verzeichniss: $APPDIR/js $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}"
ln -s $APPDIR/skin/frontend/css $1/skin/frontend/base/default/css/${APPBASELC}/${APPNAMELC}
fi
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @since 20140416
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @see http://www.matthias-zeis.com/archiv/wie-man-menu-mein-benutzerkonto-von-magento-anpasst
* @see http://magentotutorial.org/remove-links-in-the-magento-navigation-block/
*/
class Anc_Lib_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation
{
/**
* Removes the link from the account navigation.
*
* @param string $name Name provided in the layout XML file
* @return Mage_Customer_Block_Account_Navigation
*/
public function removeLinkByName($name)
{
if (isset($this->_links[$name])) {
unset($this->_links[$name]);
} else {
Mage::log("Customer account navigation link '{$name}' does not exist.", Zend_Log::NOTICE);
}
return $this;
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
//where is the controller
$this->_controller = 'adminhtml_ncrights';
$this->_blockGroup = 'anc_lib';
$this->_headerText = Mage::helper('anc_lib/data')->__('Rechte');
// //value of the add button
$this->_addButtonLabel = Mage::helper('anc_lib/data')->__('Rechte erstellen');
parent::__construct();
}
public function getCreateUrl()
{
$varParam = $this->getRequest()->getParams();
// D::s($varParam,'$varParam',5,1,1);
$var_album='';
if (array_key_exists('albumid', $varParam)) {
$var_album= '/albumid/'.$varParam['albumid'];
}
if (array_key_exists('imageid', $varParam)) {
$var_album= '/imageid/'.$varParam['imageid'];
}
if (array_key_exists('textid', $varParam)) {
$var_album= '/textid/'.$varParam['textid'];
}
if (array_key_exists('siteid', $varParam)) {
$var_album= '/siteid/'.$varParam['siteid'];
}
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'lib/adminhtml_ncrights/edit'.$var_album
);
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Edit
extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
parent::__construct();
$this->_controller = 'ncrights';
$this->_blockGroup = 'anc_lib_adminhtml';
$this->_updateButton('save', 'label', $this->__('Save'));
$this->_updateButton('delete', 'label', $this->__('Delete'));
$this->_addButton('saveandcontinue', array(
'label' => Mage::helper('adminhtml')->__('Speichern und Bearbeitung fortsetzen'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save',
), -100);
$this->_formScripts[] = "
function saveAndContinueEdit(){
editForm.submit($('edit_form').action+'back/edit/');
}
";
}
public function getHeaderText()
{
return Mage::helper('anc_album/data')->__('Rechte Container');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_lib_Block_Adminhtml_Ncrights_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
//echo 'test3';
if (Mage::registry('anc_lib')) {
$data = Mage::registry('anc_lib')->getData();
} else {
$data = array();
}
// D::s($data,'$datat',5,1);
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data'
)
);
$form->setUseContainer(true);
$this->setForm($form);
$form->setValues($data);
return parent::_prepareForm();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
// $this->setTemplate('anc/printconfigproduct/ancpcpcalendar.phtml');
// $this->setTemplate('anc/album/multiuploadncimage.phtml');
if (Mage::registry('anc_lib')) {
$data = Mage::registry('anc_lib')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_lib', array('name' => 'name')); //Mage::helper('news')->__('news information')));
$fieldset->addField('name', 'text', array(
'label' => Mage::helper('anc_lib/data')->__('Name'),
'class' => 'required-entry',
'required' => true,
'name' => 'name',
));
//
//
//
// $fieldset->addField('name', 'text', array(
// 'label' => Mage::helper('anc_album/data')->__('Name'),
// 'class' => 'required-entry',
// 'required' => true,
// 'name' => 'name',
// ));
//
// $fieldset->addField('comment', 'textarea', array(
// 'label' => Mage::helper('anc_album/data')->__('Comment'),
// 'class' => 'required-entry',
// 'required' => true,
// 'name' => 'comment',
// ));
// $fieldset->addField('link', 'link', array(
// 'label' => "Link",
// 'style' => "test",
// 'href' => 'www.excellencemagentoblog.com',
// 'value' => 'Magento Blog',
// 'name' => 'comment',
// 'after_element_html' => ''
// ));
// /**
// * Setzen der Hidden Id für Admin muss über den $data array erfolgen da sonst Magento für neue Elemente 0 setzt
// */
$data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
$fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
//
//
//
$form->addValues($data);
return parent::_prepareForm();
}
// protected function _prepareForm() {
// if (Mage::registry('anc_album')) {
// $data = Mage::registry('anc_album')->getData();
// } else {
// $data = array();
// }
// $form = new Varien_Data_Form();
// $this->setForm($form);
// $fieldset = $form->addFieldset('anc_album', array('name' => 'Info'));//Mage::helper('news')->__('news information')));
//
//// $this->_addButton('order_reorder', array(
//// 'label' => Mage::helper('sales')->__('Print Labels'),
//// 'onclick' => 'window.open(\'/printouts/' . $this->getOrder()->getRealOrderId() . '.pdf\')',
//// ));
// $fieldset->addField('link', 'link', array(
// 'label' => Mage::helper('form')->__('Link'),
// 'style' => "",
// 'href' => 'www.excellencemagentoblog.com',
// 'value' => 'Magento Blog',
// 'after_element_html' => ''
// ));
// $form->addButton('btn_add', array(
// 'label' => Mage::helper('adminhtml')->__('Add new record'),
// 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/new') .'\')',
// 'class' => 'add',
// ),-1,3);
// $data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
// $fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
//
//
//
// $form->setValues($data);
// return parent::_prepareForm();
// }
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
if (Mage::registry('anc_lib')) {
$data = Mage::registry('anc_lib')->getData();
} else {
$data = array();
}
$varParam = $this->getRequest()->getParams();
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_lib', array('name' => 'name')); //Mage::helper('news')->__('news information')));
$fieldset->addField('name', 'text', array(
'label' => Mage::helper('anc_lib/data')->__('Name'),
// 'class' => 'required-entry',
'required' => false,
'name' => 'name',
));
if ($data['entity_id']>0) {
$arrayurl['rightid'] = $data['entity_id'];
if($varParam['albumid']){
$arrayurl['albumid'] = $varParam['albumid'];
}
if($varParam['imageid']){
$arrayurl['imageid'] = $varParam['imageid'];
}
if($varParam['textid']){
$arrayurl['textid'] = $varParam['textid'];
}
if($varParam['siteid']){
$arrayurl['siteid'] = $varParam['siteid'];
}
$varurlcustomers = $this->getUrl('lib/adminhtml_ncrightscustomers/list', $arrayurl);
$varurlgroups = $this->getUrl('lib/adminhtml_ncrightsgroups/list', $arrayurl);
$fieldset->addType('ancbutton', 'Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel');
$fieldset->addField('ncrightscustommers', 'ancbutton', array(
'label' => 'hinzufügen',
'mylabel'=>'Kunden hinzufügen:',
'nctype'=>'button',
'name' => 'mycustom_element',
'required' => false,
'value' => $varurlcustomers,
'bold' => true,
'label_style' => 'font-weight: bold;',
));
$fieldset->addField('ncrightsgroups', 'ancbutton', array(
'label' => 'hinzufügen',
'mylabel'=>'Gruppen hinzufügen:',
'nctype'=>'button',
'name' => 'mycustom_element',
'required' => false,
'value' => $varurlgroups,
'bold' => true,
'label_style' => 'font-weight: bold;',
));
}else{
// Mage::getSingleton('adminhtml/session')
// ->addSuccess('Bitte Name angeben und Sichern, danach können Kunden und Gruppen hinzugefügt werden! ');
}
/**
* Setzen der Hidden Id für Admin muss über den $data array erfolgen da sonst Magento für neue Elemente 0 setzt
*/
$data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
$fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
if (array_key_exists('albumid', $varParam) && $varParam['albumid'] > 0) {
$data['albumid'] = $varParam['albumid'];
$fieldset->addField('albumid', 'hidden', array('name' => 'albumid'));
}
if (array_key_exists('imageid', $varParam) && $varParam['imageid'] > 0) {
$data['imageid'] = $varParam['imageid'];
$fieldset->addField('imageid', 'hidden', array('name' => 'imageid'));
}
if (array_key_exists('textid', $varParam) && $varParam['textid'] > 0) {
$data['textid'] = $varParam['textid'];
$fieldset->addField('textid', 'hidden', array('name' => 'textid'));
}
if (array_key_exists('siteid', $varParam) && $varParam['siteid'] > 0) {
$data['siteid'] = $varParam['siteid'];
$fieldset->addField('siteid', 'hidden', array('name' => 'siteid'));
}
/**
* Gruppen Anzeigen
*/
$item_exists = Mage::helper('anc_lib/sql')->selectFetchAll('anc_lib_ncrightsgroups', array('rights_id' => $varParam['id']));
// D::s($item_exists,'$item_exists',5,1,1);
// $groups=Mage::getModel('customer/group')->load('2');
// D::s($groups,'$groups',5,1,1);
$i=0;
foreach($item_exists as $key => $value){
$fieldset->addType('ancbutton', 'Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel');
if($i===0){
$fieldset->addField('mygrouplabel', 'ancbutton', array(
'label' => '',
'mylabel'=>'Gruppen Verwalten',
'nctype'=>'text',
'name' => 'mycustom_element',
'required' => false,
'value' => '',
'bold' => true,
'label_style' => 'font-weight: bold;color:red;',
));
}
$groups=Mage::getModel('customer/group')->load($value['customer_group_id']);
$arrayurl=array();
$arrayurl['entityid'] = $value['entity_id'];
$arrayurl['rightsid'] = $value['rights_id'];
if($varParam['albumid']){
$arrayurl['albumid'] = $varParam['albumid'];
}
if($varParam['imageid']){
$arrayurl['imageid'] = $varParam['imageid'];
}
if($varParam['textid']){
$arrayurl['textid'] = $varParam['textid'];
}
if($varParam['siteid']){
$arrayurl['siteid'] = $varParam['siteid'];
}
$varurlcgroups = $this->getUrl('lib/adminhtml_ncrights/removeGroupFromRights', $arrayurl);
$fieldset->addType('ancbutton', 'Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel');
$num= $i+1;
if(($num % 2)== 0){
$bg='';
}else{
$bg='background-color:#FFDDDD;';
}
$fieldset->addField('mygroups'.$key, 'ancbutton', array(
'label' => 'Gruppe entfernen' ,
'mylabel' => $num .'. '.$groups->getCustomerGroupCode().'ID '.$groups->getCustomerGroupId().' ',
'nctype'=>'button',
'name' => 'mycustom_element'.$key,
'required' => false,
'value' => $varurlcgroups,
'bold' => true,
'label_style' => $bg,//'<tr><td>'.$customer->getID().'</td> <td> '.$customer->getFirstname().'</td><td> '.$customer->getLastname().':</td> </tr>',//'font-weight: bold;color:red;',
));
$i++;
}
/**
* Kunden Anzeigen
*/
$item_exists = Mage::helper('anc_lib/sql')->selectFetchAll('anc_lib_ncrightscustomers', array('rights_id' => $varParam['id']));
$i=0;
foreach($item_exists as $key => $value){
$fieldset->addType('ancbutton', 'Anc_Album_Lib_Varien_Data_Form_Element_ExtendedLabel');
if($i===0){
$fieldset->addField('mylabel1', 'ancbutton', array(
'label' => '',
'mylabel'=>'Kunden Verwalten',
'nctype'=>'text',
'name' => 'mycustom_element',
'required' => false,
'value' => '',
'bold' => true,
'label_style' => 'font-weight: bold;color:red;',
));
}
$customer=Mage::getModel('customer/customer')->load($value['customer_id']);
$arrayurl=array();
$arrayurl['entityid'] = $value['entity_id'];
$arrayurl['rightsid'] = $value['rights_id'];
if($varParam['albumid']){
$arrayurl['albumid'] = $varParam['albumid'];
}
if($varParam['imageid']){
$arrayurl['imageid'] = $varParam['imageid'];
}
if($varParam['textid']){
$arrayurl['textid'] = $varParam['textid'];
}
if($varParam['siteid']){
$arrayurl['siteid'] = $varParam['siteid'];
}
$varurlcustomers = $this->getUrl('lib/adminhtml_ncrights/removeUserFromRights', $arrayurl);
$num= $i+1;
if(($num % 2)== 0){
$bg='';
}else{
$bg='background-color:#FFDDDD;';
}
$fieldset->addField('myimage'.$key, 'ancbutton', array(
'label' => 'Kunde entfernen' ,
'mylabel' => $num .'. '.$customer->getFirstname().' '.$customer->getLastname().' '.'ID '.$customer->getID().' ',
'nctype'=>'button',
'name' => 'mycustom_element'.$key,
'required' => false,
'value' => $varurlcustomers,
'bold' => true,
'label_style' => $bg,//'<tr><td>'.$customer->getID().'</td> <td> '.$customer->getFirstname().'</td><td> '.$customer->getLastname().':</td> </tr>',//'font-weight: bold;color:red;',
));
$i++;
}
$form->addValues($data);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
public function __construct() {
parent::__construct();
$this->setId('ncrights_tabs');
$this->setDestElementId('edit_form'); // this should be same as the form id define above
$this->setTitle('Rights');
// echo 'a';
}
protected function _beforeToHtml() {
$this->addTab(
'form_section', array(
'label' => Mage::helper('anc_lib/data')->__('Rechte Benutzer'),//'ncrights Info', // Mage::helper('news')->__('News Information'),
'title' => Mage::helper('anc_lib/data')->__('Rechte Benutzer'),//'ncrights Info', //Mage::helper('news')->__('News Information'),
'content' => $this->getLayout()->createBlock('anc_lib/adminhtml_ncrights_edit_tab_form')->toHtml(),
'active' => true,
)
);
// $this->addTab('form_section1', array(
// 'label' => Mage::helper('anc_lib/data')->__('Customers'),
// 'title' => Mage::helper('anc_lib/data')->__('Customers'),
// 'url' => $this->getUrl('admin/customer/', array('_current' => true)),
// 'class' => 'ajax',
// ));
// $this->addTab('form_section1', array(
// 'label' => Mage::helper('anc_lib/data')->__('Rechte Gruppen'),//'ncrights Extras', //Mage::helper('news')->__('Content'),
// 'title' => Mage::helper('anc_lib/data')->__('Rechte Gruppen'),//'ncrights Extras', //Mage::helper('news')->__('Content'),
// 'content' => $this->getLayout()->createBlock('anc_lib/adminhtml_ncrights_edit_tab_content')->toHtml(),
// ));
return parent::_beforeToHtml();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrights_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('anc_lib_ncrights_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _getCollectionClass()
{
return 'anc_lib/ncrights';
}
protected function _prepareCollection()
{
//
// $varParam = $this->getRequest()->getParams();
// if(array_key_exists('kind', $varParam)&& $varParam['albumid']=='users') {
// echo "<h1>Alle Alben der Benutzer: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'admin',)).'" >Alben Admin</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('customer_id',array('gt'=>0));;
//
// }else{
// echo "<h1>Alle Alben der Administratoren: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'users',)).'" >Alben der Benutzer</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('admin_user_id',array('gt'=>0));;
//
// }
$collection = Mage::getModel('anc_lib/ncrights')->getCollection();
// D::s($collection,'$collection',15,1,1);
$this->setCollection($collection);
// D::s($collection,'$collection',5,1,1);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('entity_id',
array(
'header' => Mage::helper('anc_lib/data')->__('Id'),
'align' =>'right',
'width' => '50px',
'index' => 'entity_id',
));
$this->addColumn('name',
array(
'header' => Mage::helper('anc_lib/data')->__('Name'),
'align' =>'left',
'index' => 'name',
));
$this->addColumn('admin_user_id', array(
'header' => Mage::helper('anc_lib/data')->__('Admin'),
'align' =>'left',
'index' => 'admin_user_id',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('anc_lib/data')->__('Created'),
'align' =>'left',
'index' => 'created_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_lib/data')->__('Updated'),
'align' =>'left',
'index' => 'updated_at',
));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
$varParam = $this->getRequest()->getParams();
// D::s($varParam,'$varParam',5,1);
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrightscustomers extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
//where is the controller
$this->_controller = 'adminhtml_ncrightscustomers';
$this->_blockGroup = 'anc_lib';
$this->_headerText = Mage::helper('anc_lib/data')->__('Rechte');
// //value of the add button
$this->_addButtonLabel = Mage::helper('anc_lib/data')->__('Rechte erstellen');
parent::__construct();
$this->_removeButton('add');
}
public function getCreateUrl()
{
$varParam = $this->getRequest()->getParams();
D::s($varParam,'$varParam',5,1);
$var_album='';
if (array_key_exists('albumid', $varParam)) {
$var_album= '/albumid/'.$varParam['albumid'];
}
if (array_key_exists('imageid', $varParam)) {
$var_album= '/imageid/'.$varParam['imageid'];
}
if (array_key_exists('textid', $varParam)) {
$var_album= '/textid/'.$varParam['textid'];
}
if (array_key_exists('siteid', $varParam)) {
$var_album= '/siteid/'.$varParam['siteid'];
}
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'lib/adminhtml_ncrights/edit'.$var_album
);
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrightscustomers_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('anc_lib_ncrightscutomers_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _getCollectionClass()
{
// return 'anc_lib/ncrightscutomers';
}
protected function _prepareCollection()
{
//
// $varParam = $this->getRequest()->getParams();
// if(array_key_exists('kind', $varParam)&& $varParam['albumid']=='users') {
// echo "<h1>Alle Alben der Benutzer: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'admin',)).'" >Alben Admin</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('customer_id',array('gt'=>0));;
//
// }else{
// echo "<h1>Alle Alben der Administratoren: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'users',)).'" >Alben der Benutzer</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('admin_user_id',array('gt'=>0));;
//
// }
// $collection = Mage::getModel('anc_lib/ncrightscutomers')->getCollection();
$collection = Mage::getModel('customer/customer')->getCollection()
->addAttributeToSelect('entity_id')
->addAttributeToSelect('firstname')
->addAttributeToSelect('lastname')
->addAttributeToSelect('email');
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('entity_id',
array(
'header' => Mage::helper('anc_lib/data')->__('Id'),
'align' =>'right',
'width' => '50px',
'index' => 'entity_id',
));
$this->addColumn('firstname',
array(
'header' => Mage::helper('anc_lib/data')->__('firstname'),
'align' =>'left',
'index' => 'firstname',
));
$this->addColumn('lastname', array(
'header' => Mage::helper('anc_lib/data')->__('lastname'),
'align' =>'left',
'index' => 'lastname',
));
$this->addColumn('email', array(
'header' => Mage::helper('anc_lib/data')->__('email'),
'align' =>'left',
'index' => 'email',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('anc_lib/data')->__('Created'),
'align' =>'left',
'index' => 'created_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_lib/data')->__('Updated'),
'align' =>'left',
'index' => 'updated_at',
));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
$var_params= $this->getRequest()->getParams();
return $this->getUrl('*/*/edit', array('userid' => $row->getId(),'rightid'=>$var_params['rightid'],'albumid'=>$var_params['albumid'],'imageid'=>$var_params['imageid'],'textid'=>$var_params['textid'],'siteid'=>$var_params['siteid']));
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrightsgroups extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
//where is the controller
$this->_controller = 'adminhtml_ncrightsgroups';
$this->_blockGroup = 'anc_lib';
$this->_headerText = Mage::helper('anc_lib/data')->__('Rechte');
// //value of the add button
// $this->_addButtonLabel = Mage::helper('anc_lib/data')->__('Rechte erstellen');
// parent::__cnstruct();
parent::__construct();
$this->_removeButton('add');
}
public function getCreateUrl()
{
$varParam = $this->getRequest()->getParams();
// D::s($varParam,'$varParam',5,1);
$var_album='';
if (array_key_exists('albumid', $varParam)) {
$var_album= '/albumid/'.$varParam['albumid'];
}
if (array_key_exists('imageid', $varParam)) {
$var_album= '/imageid/'.$varParam['imageid'];
}
if (array_key_exists('textid', $varParam)) {
$var_album= '/textid/'.$varParam['textid'];
}
if (array_key_exists('siteid', $varParam)) {
$var_album= '/siteid/'.$varParam['siteid'];
}
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'lib/adminhtml_ncrights/edit'.$var_album
);
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Ncrightsgroups_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('anc_lib_ncrightsgroups_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _getCollectionClass()
{
// return 'anc_lib/ncrightscutomers';
}
protected function _prepareCollection()
{
//
// $varParam = $this->getRequest()->getParams();
// if(array_key_exists('kind', $varParam)&& $varParam['albumid']=='users') {
// echo "<h1>Alle Alben der Benutzer: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'admin',)).'" >Alben Admin</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('customer_id',array('gt'=>0));;
//
// }else{
// echo "<h1>Alle Alben der Administratoren: </h1>";
// echo '<a href="'.$this->getUrl('lib/adminhtml_ncrights/list', array('kind' => 'users',)).'" >Alben der Benutzer</a>';
// $collection = Mage::getModel('anc_lib/ncrights')->getCollection()->addFieldToFilter('admin_user_id',array('gt'=>0));;
//
// }
// $collection = Mage::getModel('anc_lib/ncrightscutomers')->getCollection();
$collection = Mage::getModel('customer/group')->getCollection();
// ->addAttributeToSelect('customer_group_id')
// ->addAttributeToSelect('customer_group_code');
// D::s($collection,'$collection',15,1,1);
$this->setCollection($collection);
// D::s($collection,'$collection',5,1,1);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('customer_group_id',
array(
'header' => Mage::helper('anc_lib/data')->__('Group ID'),
'align' =>'left',
'index' => 'customer_group_id',
));
$this->addColumn('customer_group_code', array(
'header' => Mage::helper('anc_lib/data')->__('customer_group_code'),
'align' =>'left',
'index' => 'customer_group_code',
));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
$var_params= $this->getRequest()->getParams();
// D::s($var_params,'entity_id',5,1);
return $this->getUrl('*/*/edit', array('groupid' => $row->getId(),'rightid'=>$var_params['rightid'],'albumid'=>$var_params['albumid'],'imageid'=>$var_params['imageid'],'textid'=>$var_params['textid'],'siteid'=>$var_params['siteid']));
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables extends Mage_Adminhtml_Block_Widget_Grid_Container {
public function __construct() {
$this->_controller = 'adminhtml_timetables';
$this->_blockGroup = 'anc_lib';
$this->_headerText = Mage::helper('anc_lib/data')->__('Timetable');
$this->_addButtonLabel = Mage::helper('anc_lib/data')->__('Timetable erstellen');
parent::__construct();
}
public function getCreateUrl()
{
/**
* Wichtig für Add Button
*/
return $this->getUrl(
'lib/adminhtml_timetable/edit'
);
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Edit
extends Mage_Adminhtml_Block_Widget_Form_Container
{
protected function _construct()
{
$this->_controller = 'timetables';
$this->_blockGroup = 'anc_lib_adminhtml';
$this->_updateButton('save', 'label', $this->__('Save'));
$this->_updateButton('delete', 'label', $this->__('Delete'));
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
//echo 'test3';
if (Mage::registry('anc_lib')) {
$data = Mage::registry('anc_lib')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data'
)
);
$form->setUseContainer(true);
$this->setForm($form);
$form->setValues($data);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
if (Mage::registry('anc_timetable')) {
$data = Mage::registry('anc_timetable')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_timetable', array('name' => 'Info'));//Mage::helper('news')->__('news information')));
$form->setValues($data);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
protected function _prepareForm() {
$arrayhour = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23');
$arraymin = array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29',
'30' => '30', '31' => '31', '32' => '32', '33' => '33', '34' => '34', '35' => '35', '36' => '36', '37' => '37', '38' => '38', '39' => '39', '40' => '40', '41' => '41', '42' => '42', '43' => '43', '44' => '44', '44' => '45', '46' => '46', '47' => '47', '48' => '48', '49' => '49', '50' => '50', '51' => '51', '52' => '52', '53' => '53', '54' => '54', '55' => '55', '56' => '56', '57' => '57', '58' => '58', '59' => '59');
if (Mage::registry('anc_timetable')) {
$data = Mage::registry('anc_timetable')->getData();
} else {
$data = array();
}
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('anc_timetable', array('name' => 'name')); //Mage::helper('news')->__('news information')));
$fieldset->addField('name', 'text', array(
'label' => Mage::helper('anc_lib/data')->__('Name'),
'class' => 'required-entry',
'required' => true,
'name' => 'name',
));
$fieldset->addField('comment', 'textarea', array(
'label' => Mage::helper('anc_lib/data')->__('Comment'),
'class' => 'required-entry',
'required' => true,
'name' => 'comment',
));
$fieldset->addField('start', 'date', array(
'label' => Mage::helper('anc_lib/data')->__('Start'),
'class' => 'required-entry',
'required' => true,
'name' => 'start',
'tabindex' => 1,
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
));
$fieldset->addField('stop', 'date', array(
'label' => Mage::helper('anc_lib/data')->__('Stop'),
'class' => 'required-entry',
'required' => true,
'name' => 'stop',
'tabindex' => 1,
'image' => $this->getSkinUrl('images/grid-cal.gif'),
'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
));
$fieldset->addField('starthour', 'select', array(
'label' => Mage::helper('anc_lib/data')->__('Starthour'),
'class' => 'required-entry',
'required' => true,
'name' => 'starthour',
'onclick' => "",
'onchange' => "",
'values' => $arrayhour,
'disabled' => false,
'readonly' => false,
));
$fieldset->addField('stophour', 'select', array(
'label' => Mage::helper('anc_lib/data')->__('stophour'),
'class' => 'required-entry',
'required' => true,
'name' => 'stophour',
'onclick' => "",
'onchange' => "",
'values' => $arrayhour,
'disabled' => false,
'readonly' => false,
));
$fieldset->addField('startmin', 'select', array(
'label' => Mage::helper('anc_lib/data')->__('startmin'),
'class' => 'required-entry',
'required' => true,
'name' => 'startmin',
'onclick' => "",
'onchange' => "",
// 'value' => '1',
'values' => $arraymin,
'disabled' => false,
'readonly' => false,
'tabindex' => 2
));
$fieldset->addField('stopmin', 'select', array(
'label' => Mage::helper('anc_lib/data')->__('stopmin'),
'class' => 'required-entry',
'required' => true,
'name' => 'stopmin',
'onclick' => "",
'onchange' => "",
'values' => $arraymin,
'disabled' => false,
'readonly' => false,
));
$fieldset->addField('monday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('monday'),
'name' => 'monday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('tuesday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('tuesday'),
'name' => 'tuesday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('wednesday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('wednesday'),
'name' => 'wednesday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('thursday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('thursday'),
'name' => 'thursday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('friday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('friday'),
'name' => 'friday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('saturday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('saturday'),
'name' => 'saturday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
$fieldset->addField('sunday', 'radios', array(
'label' => Mage::helper('anc_lib/data')->__('sunday'),
'name' => 'sunday',
'onclick' => "",
'onchange' => "",
'value' => '1',
'values' => array(
array('value' => '1', 'label' => 'Ja'),
array('value' => '0', 'label' => 'Nein'),
),
'disabled' => false,
'readonly' => false,
'tabindex' => 1
));
/**
* Setzen der Hidden Id für Admin muss über den $data array erfolgen da sonst Magento für neue Elemente 0 setzt
*/
$data['admin_user_id'] = $admin = Mage::getSingleton('admin/session')->getUser()->getId();
$fieldset->addField('admin_user_id', 'hidden', array('name' => 'admin_user_id'));
$form->setValues($data);
return parent::_prepareForm();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
public function __construct() {
parent::__construct();
$this->setId('timetables_tabs');
$this->setDestElementId('edit_form'); // this should be same as the form id define above
$this->setTitle('Timetables');
// echo 'a';
}
protected function _beforeToHtml() {
$this->addTab(
'form_section', array(
'label' => 'Timetables Info', // Mage::helper('news')->__('News Information'),
'title' => 'Timetables Info', //Mage::helper('news')->__('News Information'),
'content' => $this->getLayout()->createBlock('anc_lib/adminhtml_timetables_edit_tab_form')->toHtml(),
)
);
$this->addTab('form_section1', array(
'label' => 'Timetables Extras', //Mage::helper('news')->__('Content'),
'title' => 'Timetables Extras', //Mage::helper('news')->__('Content'),
'content' => $this->getLayout()->createBlock('anc_lib/adminhtml_timetables_edit_tab_content')->toHtml(),
));
return parent::_beforeToHtml();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Block_Adminhtml_Timetables_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('anc_lib_timetables_grid');
$this->setDefaultSort('entity_id');
$this->setDefaultDir('DESC');
$this->setSaveParametersInSession(true);
}
protected function _getCollectionClass()
{
return 'anc_lib/timetable';
}
protected function _prepareCollection()
{
$collection = Mage::getModel('anc_lib/timetable')->getCollection()->addFieldToFilter('customer_id',array('lt'=>1));;
// D::s($collection,'$collection',15,1,1);
$this->setCollection($collection);
// D::s($collection,'$collection',5,1,1);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('entity_id',
array(
'header' => Mage::helper('anc_lib/data')->__('Id'),
'align' =>'right',
'width' => '50px',
'index' => 'entity_id',
));
$this->addColumn('name',
array(
'header' => Mage::helper('anc_lib/data')->__('Name'),
'align' =>'left',
'index' => 'name',
));
$this->addColumn('comment', array(
'header' => Mage::helper('anc_lib/data')->__('Comment'),
'align' =>'left',
'index' => 'comment',
));
$this->addColumn('admin_user_id', array(
'header' => Mage::helper('anc_lib/data')->__('Admin'),
'align' =>'left',
'index' => 'admin_user_id',
));
$this->addColumn('customer_id', array(
'header' => Mage::helper('anc_lib/data')->__('Customer'),
'align' =>'left',
'index' => 'customer_id',
));
$this->addColumn('created_at', array(
'header' => Mage::helper('anc_lib/data')->__('Created'),
'align' =>'left',
'index' => 'created_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_lib/data')->__('Updated'),
'align' =>'left',
'index' => 'updated_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_lib/data')->__('Updated'),
'align' =>'left',
'index' => 'updated_at',
));
$this->addColumn('updated_at', array(
'header' => Mage::helper('anc_lib/data')->__('Updated'),
'align' =>'left',
'index' => 'updated_at',
));
$this->addColumn('start', array(
'header' => Mage::helper('anc_lib/data')->__('Start'),
'align' =>'left',
'index' => 'start',
));
$this->addColumn('stop', array(
'header' => Mage::helper('anc_lib/data')->__('Stop'),
'align' =>'left',
'index' => 'stop',
));
$this->addColumn('starthour', array(
'header' => Mage::helper('anc_lib/data')->__('Starthour'),
'align' =>'left',
'index' => 'starthour',
));
$this->addColumn('stophour', array(
'header' => Mage::helper('anc_lib/data')->__('Stophour'),
'align' =>'left',
'index' => 'stophour',
));
$this->addColumn('startmin', array(
'header' => Mage::helper('anc_lib/data')->__('Startmin'),
'align' =>'left',
'index' => 'startmin',
));
$this->addColumn('stopmin', array(
'header' => Mage::helper('anc_lib/data')->__('Stopmin'),
'align' =>'left',
'index' => 'stopmin',
));
$this->addColumn('monday', array(
// 'type' => 'checkbox',
'values' => array(0,1),
'field_name' => 'checkbox_name',
'header' => Mage::helper('anc_lib/data')->__('Monday'),
'align' =>'left',
'index' => 'monday',
));
$this->addColumn('tuesday', array(
'header' => Mage::helper('anc_lib/data')->__('Tuesday'),
'values' => array(0,1),
'align' =>'left',
'index' => 'tuesday',
));
$this->addColumn('wednesday', array(
'header' => Mage::helper('anc_lib/data')->__('Wednesday'),
'align' =>'left',
'index' => 'wednesday',
));
$this->addColumn('thursday', array(
'header' => Mage::helper('anc_lib/data')->__('Thursday'),
'align' =>'left',
'index' => 'thursday',
));
$this->addColumn('friday', array(
'header' => Mage::helper('anc_lib/data')->__('Friday'),
'align' =>'left',
'index' => 'friday',
));
$this->addColumn('saturday', array(
'header' => Mage::helper('anc_lib/data')->__('Saturday'),
'align' =>'left',
'index' => 'saturday',
));
$this->addColumn('sunday', array(
'header' => Mage::helper('anc_lib/data')->__('Sunday'),
'align' =>'left',
'index' => 'sunday',
));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Extension extends Mage_Core_Helper_Abstract {
// public function isProductAncImage(Mage_Catalog_Model_Product $param_product) {
// if(is_object($param_product)) {
// if (strpos($param_product->getSku(), Mage::helper('anc_image/ncconstant')->ancSPImage) !== false) {
// return true;
// }
// }
// return false;
// }
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Ncfilepath extends Mage_Core_Helper_Abstract {
public function getThisMagentoInstallationPath() {
// return '/media/data/dev/Magento/Magento18/';
// return '/var/www/Magento/Magento19';
// Mage::getBaseDir() ---- wäre auch ne möglich keit
// ..DOCUMENT_ROOT gibt /var/www zurück
// getBaseDir falls /var/www nur ein symbolischer link ist den richtigen ort
return $_SERVER['DOCUMENT_ROOT'].'/';
}
public function getModuleFilepath($param_modulename, $param_temp=false) {
if($param_temp) {
$tmpdir = DS.'tmp';
} else {
$tmpdir = '';
}
$modulearray = explode('_', $param_modulename);
$module_path = 'media'.DS.$modulearray[0].$tmpdir.DS.$modulearray[1].DS;
mcDir::create($module_path);
return $module_path;
}
public function getModuleCustomerFilepath($param_modulename, $param_temp=false) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
if(is_object($customer)) {
$customer_id = $customer->getId();
} else {
$customer_id = 0;
}
$module_path = $this->getModuleFilepath($param_modulename, $param_temp);
$ModuleCustomerFilepath = $module_path.'customer'.DS.$customer_id.DS;
mcDir::create($ModuleCustomerFilepath);
return $ModuleCustomerFilepath;
}
}
?>
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Ncmodel extends Mage_Core_Helper_Abstract {
/**
* cache für anc_lib/ncrights models
* @var array
*/
private $NcRights = array();
/**
*
* @param int $param_ncrights_id
* @return anc_lib/ncrights
*
* $ncright = Mage::getModel('anc_lib/ncmodel')->getNcRight($param_model->getNcrightId());
*/
public function getNcRight($param_ncrights_id) {
if($param_ncrights_id) {
if(!array_key_exists($param_ncrights_id, $this->NcRights)) {
$ncrights = Mage::getModel('anc_lib/ncrights')->load($param_ncrights_id);
$this->NcRights[$param_ncrights_id] = $ncrights;
}
return $this->NcRights[$param_ncrights_id];
} else {
return false;
}
}
public function saveNcRight(Anc_Lib_Model_Ncrights $param_ncrights) {
if(is_object($param_ncrights)) {
$param_ncrights->save();
$this->NcRights[$param_ncrights->getId()] = $param_ncrights;
return $this->NcRights[$param_ncrights->getId()];
} else {
return false;
}
}
private $NcRightcustomers = array();
/**
*
* @param int $param_ncrights_id
* @return anc_lib/ncrights
*
* $ncright = Mage::getModel('anc_lib/ncmodel')->getNcRight($param_model->getNcrightId());
*/
public function getNcRightcustomers($param_ncrights_id) {
if($param_ncrights_id) {
if(!array_key_exists($param_ncrights_id, $this->NcRightcustomers)) {
$ncrightscustomers = Mage::getModel('anc_lib/ncrightscustomers')->getCollection()->addFieldToFilter('rights_id', $param_ncrights_id);
$this->NcRightcustomers[$param_ncrights_id] = $ncrightscustomers;
}
return $this->NcRightcustomers[$param_ncrights_id];
} else {
return false;
}
}
private $NcRightgroups = array();
/**
*
* @param int $param_ncrights_id
* @return anc_lib/ncrights
*
* $ncright = Mage::getModel('anc_lib/ncmodel')->getNcRight($param_model->getNcrightId());
*/
public function getNcRightgroups($param_ncrights_id) {
if($param_ncrights_id) {
if(!array_key_exists($param_ncrights_id, $this->NcRightgroups)) {
$ncrightsgroups = Mage::getModel('anc_lib/ncrightsgroups')->getCollection()->addFieldToFilter('rights_id', $param_ncrights_id);
$this->NcRightgroups[$param_ncrights_id] = $ncrightsgroups;
}
return $this->NcRightgroups[$param_ncrights_id];
} else {
return false;
}
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Ncrights extends Mage_Core_Helper_Abstract {
/**
* @todo diese info muss eigentlich in die jeweiligen extension ausgelagert werden
* @var type
*/
private $loadedNcModels = array(
'anc_playlist/ncplaylist' => array(),
'anc_album/ncalbum' => array(),
'anc_image/ncimage' => array(),
'anc_text/nctext' => array(),
'anc_addressimport/ncaddressimport' => array(),
'anc_addressimport/ncaddressimport_item' => array(),
);
private function checkReadRightGroups(Mage_Core_Model_Abstract $param_model) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
$ncrightsgroups = Mage::helper('anc_lib/ncmodel')->getNcRightgroups($param_model->getNcrightId());
if(is_object($ncrightsgroups)) {
foreach($ncrightsgroups->getData() as $ncrightsgroup) {
if($customer->getGroupId() === $ncrightsgroup['customer_group_id']) {
return true;
}
}
return false;
}
return true;
}
private function checkReadRightCustomers(Mage_Core_Model_Abstract $param_model) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
$ncrightscustomers = Mage::helper('anc_lib/ncmodel')->getNcRightcustomers($param_model->getNcrightId());
if(is_object($ncrightscustomers)) {
foreach($ncrightscustomers->getData() as $ncrightscustomer) {
if($ncrightscustomer['customer_id']=== $customer->getId()) {
return true;
}
}
return false;
}
return true;
}
private function checkIfReadRightCustomersGroupEmpty(Mage_Core_Model_Abstract $param_model) {
$ncrightscustomers = Mage::helper('anc_lib/ncmodel')->getNcRightcustomers($param_model->getNcrightId());
$ncrightsgroups = Mage::helper('anc_lib/ncmodel')->getNcRightgroups($param_model->getNcrightId());
if(is_object($ncrightsgroups)) {
if(empty($ncrightscustomers->getData()) && empty($ncrightsgroups->getData())) {
return true;
}
return false;
}
return true;
}
private function checkReadRight(Mage_Core_Model_Abstract $param_model) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
if(!$param_model->getId()) {
return true;
} else if($param_model->getCustomerId() === $customer->getId()) {
return true;
} else if($param_model->getNcrightId() === 0) {
return true;
} else if($this->checkReadRightCustomers($param_model)) {
return true;
} else if($this->checkReadRightGroups($param_model)) {
return true;
} else if($this->checkIfReadRightCustomersGroupEmpty($param_model)) {
return true;
} else {
return false;
}
}
private function checkWriteRight(Mage_Core_Model_Abstract $param_model) {
$customer = Mage::getSingleton('customer/session')->getCustomer();
if(!$param_model->getId()) {
return true;
} else if($param_model->getCustomerId() === $customer->getId()) {
return true;
} else {
return false;
}
}
private function checkIfIsSupported($param_resourcename) {
if(is_object($param_resourcename)) {
$param_resourcename = $param_resourcename->getResourceName();
}
if(array_key_exists($param_resourcename, $this->loadedNcModels) && is_array($this->loadedNcModels[$param_resourcename])) {
return true;
} else {
D::li("checkIfIsSupported($param_resourcename): $param_resourcename hat noch kein ncrights !!!!");
return false;
}
}
public function loadNcModel($param_resourcename, $param_id) {
if($this->checkIfIsSupported($param_resourcename)) {
if(!array_key_exists($param_id, $this->loadedNcModels[$param_resourcename])) {
$ncmodel = Mage::getModel($param_resourcename)->load($param_id);
$this->loadedNcModels[$param_resourcename][$param_id] = $ncmodel;
}
if($this->checkReadRight($this->loadedNcModels[$param_resourcename][$param_id])) {
return $this->loadedNcModels[$param_resourcename][$param_id];
} else {
return false;
}
} else {
return false;
}
}
/**
*
* @param string $param_resourcename
* @param type $param_filtername
* @param type $param_filtervalue
* @return type
*/
public function getNcModelsByOneFilter( $param_resourcename, $param_filtername, $param_filtervalue) {
if($this->checkIfIsSupported($param_resourcename) ) {
$Collection= Mage::getModel($param_resourcename)->getCollection();
if(is_array($param_filtername)){
foreach($param_filtername as $key =>$value){
$Collection = $Collection->addFieldToFilter($value, $param_filtervalue[$key]);
}
}else{
$Collection = $Collection->addFieldToFilter($param_filtername, $param_filtervalue);
}
$result_array = array();
foreach($Collection->getData() as $key => $Collectrow) {
$ncmodel = $this->loadNcModel($param_resourcename, $Collectrow['entity_id']);
if(is_object($ncmodel)) {
$result_array[] = $ncmodel->getData();
}
}
$Collection->setDataAnc($result_array);
return $Collection;//Mage::getModel($param_resourcename)->getCollection()->addFieldToFilter($param_filtername, $param_filtervalue);
}
}
public function getNcModelBy($param_resourcename, $param_column, $param_value) {
if($this->checkIfIsSupported($param_resourcename)) {
$ncmodel = Mage::getModel($param_resourcename)->load($param_value, $param_column);
$this->loadedNcModels[$param_resourcename][$ncmodel->getId()] = $ncmodel;
if($this->checkReadRight($this->loadedNcModels[$param_resourcename][$ncmodel->getId()])) {
return $this->loadedNcModels[$param_resourcename][$ncmodel->getId()];
} else {
return false;
}
} else {
return false;
}
}
public function saveNcModel(Mage_Core_Model_Abstract $param_model) {
if($this->checkIfIsSupported($param_model) && $this->checkWriteRight($param_model)) {
if(is_object($param_model)) {
$param_model->save();
return $param_model;
} else {
return false;
}
} else {
return false;
}
}
public function deleteNcModel(Mage_Core_Model_Abstract $param_model) {
if($this->checkIfIsSupported($param_model) && $this->checkWriteRight($param_model)) {
if(is_object($param_model)) {
return $param_model->delete();
// return $param_model;
} else {
return false;
}
} else {
return false;
}
}
}
?>
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Product extends Mage_Core_Helper_Abstract {
private $attributsets = array() ;
/**
* gibt den attributset name zurück
*
* @param int $param_id - attribute_set_id
* @return string
*/
public function getAttributeSetName($param_id) {
if(!array_key_exists($param_id, $this->attributsets)) {
$attribute_set_name = Mage::helper('anc_lib/sql')->selectFetchOne(
'attribute_set_name',
'eav_attribute_set',
array('attribute_set_id' => $param_id)
);
$this->attributsets[$param_id] = $attribute_set_name;
}
return $this->attributsets[$param_id];
}
/**
* gibt product model zurück und speichert es intern im CACHE
*
* @param int $param_id
* @return Mage_Catalog_Model_Product
*/
public function getProduct($param_id) {
if(!array_key_exists($param_id, $this->CACHE_products)) {
$this->CACHE_products[$param_id] = Mage::getModel("catalog/product");
$this->CACHE_products[$param_id]->load($param_id);
}
return $this->CACHE_products[$param_id];
}
private $CACHE_products = array();
/**
* gibt Product sku zurück
*
* @param int $param_id
* @return string
*/
public function getProductSku($param_id) {
$product = $this->getProduct($param_id);
return $product->getData('sku');
}
/**
* fnc setzt parameter für eine vorhandene individuelle option
* sie muss mit der sku eindeutig sein, und darf nur einmal in kombination $param_product_id, $param_option_sku vorkommen
* ansonsten gibts nen fehler!!!!!
*
*
* @param int $param_product_id
* @param string $param_option_sku
* @param string $param_max_characters=null - wenn null Wert wird nicht gesetzt
* @param string $param_file_extension=null - wenn null Wert wird nicht gesetzt
* @param int $param_image_size_x=null - wenn null Wert wird nicht gesetzt
* @param int $param_image_size_y=null - wenn null Wert wird nicht gesetzt
*/
public function setIndividuelOptionWithoutOptionID($param_product_id, $param_option_sku, $param_max_characters=NULL, $param_file_extension=NULL, $param_image_size_x=NULL, $param_image_size_y=NULL) {
if($param_product_id && $param_option_sku) {
$option_id = Mage::helper('anc_lib/sql')->selectFetchCol(
'option_id',
'catalog_product_option',
array(
'product_id' => $param_product_id,
'sku' => $param_option_sku
)
);
if(is_array($option_id) && count($option_id) && $option_id[0]) {
$where = array( 'option_id' => $option_id[0]);
if(!is_null($param_max_characters)) {
Mage::helper('anc_lib/sql')->updateOneCell('catalog_product_option', 'max_characters', $param_max_characters, $where);
}
if(!is_null($param_file_extension)) {
Mage::helper('anc_lib/sql')->updateOneCell('catalog_product_option', 'file_extension', $param_file_extension, $where);
}
if(!is_null($param_image_size_x)) {
Mage::helper('anc_lib/sql')->updateOneCell('catalog_product_option', 'image_size_x', $param_image_size_x, $where);
}
if(!is_null($param_image_size_y)) {
Mage::helper('anc_lib/sql')->updateOneCell('catalog_product_option', 'image_size_y', $param_image_size_y, $where);
}
} else {
if(is_array($option_id) && empty($option_id)) {
D::li('FEHLER: keine option_id gefunden $param_product_id('.$param_product_id.'), $param_option_sku('.$param_option_sku.')');
} else {
D::fe($option_id, 'FEHLER: ermittelte option_id ist nicht eindeutig $param_product_id('.$param_product_id.'), $param_option_sku('.$param_option_sku.')');
}
return false;
}
} else {
D::li('FEHLER: es müssen $param_product_id und $param_option_sku übergeben werden ');
return false;
}
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Helper_Timetable extends Mage_Core_Helper_Abstract {
public function insertTimetable($p_name, $p_comment = False, $p_admin_user_id = NULL, $p_customer_id = NULL, $p_start = FALSE, $p_stop = FALSE, $p_starthour = 0, $p_stophour = 23, $p_startmin = 0, $p_stopmin = 59, $p_monday = 1, $p_tuesday = 1, $p_wednesday = 1, $p_thursday = 1, $p_friday = 1, $p_saturday = 1, $p_sunday = 1) {
$timeteable = Mage::getModel('anc_lib/timetable');
$timeteable->setData('name', $p_name);
if ($p_comment) {
$timeteable->setData('comment', $p_comment);
}
if ($p_admin_user_id) {
$timeteable->setData('admin_user_id', $p_admin_user_id);
}
if ($p_customer_id) {
$timeteable->setData('customer_id', $p_customer_id);
}
if ($p_start) {
$timeteable->setData('start', $p_start);
} else {
$time = time();
$timeteable->setData('start', $p_start);
}
if ($p_stop) {
$timeteable->setData('stop', $p_stop);
} else {
// Wochen /Tage/ Stunden / Min / Sek
$time = time() + (4 * 7 * 24 * 60 * 60);
$timeteable->setData('stop', $p_stop);
}
$timeteable->setData('starthour', $p_starthour);
$timeteable->setData('stophour', $p_stophour);
$timeteable->setData('startmin', $p_startmin);
$timeteable->setData('stopmin', $p_stopmin);
$timeteable->setData('monday', $p_monday);
$timeteable->setData('tuesday', $p_tuesday);
$timeteable->setData('wednesday', $p_wednesday);
$timeteable->setData('thursday', $p_thursday);
$timeteable->setData('friday', $p_friday);
$timeteable->setData('saturday', $p_saturday);
$timeteable->setData('sunday', $p_sunday);
$newId = $timeteable->save()->getId();
return $newId;
}
public function updateTimetable($p_id, $p_name=FALSE, $p_comment = False, $p_start = FALSE, $p_stop = FALSE, $p_starthour =FALSE, $p_stophour =FALSE, $p_startmin =FALSE, $p_stopmin =FALSE, $p_monday =FALSE, $p_tuesday=FALSE, $p_wednesday =FALSE, $p_thursday =FALSE, $p_friday =FALSE, $p_saturday =FALSE, $p_sunday =FALSE) {
$data = array();
if ($p_name !== FALSE) {
$data['name'] = $p_name;
}
if ($p_comment !== FALSE) {
$data['comment'] = $p_comment;
}
if ($p_start !== FALSE) {
$data['start'] = $p_start;
}
if ($p_stop !== FALSE) {
$data['stop'] = $p_stop;
}
if ($p_starthour !== FALSE) {
$data['starthour'] = $p_starthour;
}
if ($p_stophour !== FALSE) {
$data['stophour'] = $p_stophour;
}
if ($p_startmin !== FALSE) {
$data['startmin'] = $p_startmin;
}
if ($p_stopmin !== FALSE) {
$data['stopmin'] = $p_stopmin;
}
if ($p_monday !== FALSE) {
$data['monday'] = $p_monday;
}
if ($p_tuesday !== FALSE) {
$data['tuesday'] = $p_tuesday;
}
if ($p_wednesday !== FALSE) {
$data['wednesday'] = $p_wednesday;
}
if ($p_thursday !== FALSE) {
$data['thursday'] = $p_thursday;
}
if ($p_friday !== FALSE) {
$data['friday'] = $p_friday;
}
if ($p_saturday !== FALSE) {
$data['saturday'] = $p_saturday;
}
if ($p_sunday !== FALSE) {
$data['sunday'] = $p_sunday;
}
$timeteable = Mage::getModel('anc_lib/timetable')->load($p_id)->addData($data);
try {
$timeteable->setId($p_id)->save();
echo "Data updated successfully.";
return TRUE;
} catch (Exception $e) {
echo $e->getMessage();
return FALSE;
}
}
public function deleteTimetable($p_id) {
$timeteable = Mage::getModel('anc_lib/timetable');
try {
$timeteable->setId($p_id)->delete();
echo "Data deleted successfully.";
return TRUE;
} catch (Exception $e) {
echo $e->getMessage();
return False;
}
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Diese Klasse Existiert in Mehreren Extensions von uns und Muss im Zweifel leider in allen geändert werden!
*
* Dies geschah aus Faulheit und unwissenheit wie auf die Lib eioner anderen Extension zugegriffen werden kann!
*
* !!!!
*/
class Anc_Album_Lib_Varien_Data_Form_Element_ExtendedButton extends Varien_Data_Form_Element_Abstract
{
public function __construct($attributes=array())
{
parent::__construct($attributes);
$this->setType('label');
}
public function getElementHtml()
{
//'<button type="button" value="Open Window" onclick="window.open(\'' . $varurlimages . '\')">Bilder des Albums verwalten</button>';
//
$var_url= $this->getEscapedValue();
$var_label= $this->getLabel();
// D::s($var_name,'$var_name',5,1,1);
$html = '<button title="'.$var_label.'" onclick="window.open(\''.$var_url . '\')"><span>'.$var_label.'</span></button>';
$html.= $this->getAfterElementHtml();
return $html;
}
public function getLabelHtml($idSuffix = ''){
// if (!is_null($this->getLabel())) {
$html = '<label for="'.$this->getHtmlId() . $idSuffix . '" style="'.$this->getLabelStyle().'">'.$this->getLabel()
. ( $this->getRequired() ? ' <span class="required">*</span>' : '' ).'</label>'."\n";
// }
// else {
// $html = '';
// }
return $html;
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrights extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrights');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
class Anc_Lib_Model_Ncrights_Collection extends Mage_Core_Model_Collection_Abstract{
public function _construct(){
$this->_init('anc_lib/ncrights');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrights extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrights');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrightscustomers extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrightscustomers');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrightscustomers extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrightscustomers');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrightsgroups extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrightsgroups');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Ncrightsgroups extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/ncrightsgroups');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrights extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_lib/ncrights', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $ncrights) {
if(!$ncrights->getId()) {
$ncrights->setCreatedAt(now());
}
$ncrights->setUpdatedAt(now());
return parent::_beforeSave($ncrights);
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrights_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_lib/ncrights');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrightscustomers extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_lib/ncrightscustomers', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $site) {
if(!$site->getId()) {
$site->setCreatedAt(now());
}
$site->setUpdatedAt(now());
return parent::_beforeSave($site);
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrightscustomers_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_lib/ncrightscustomers');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrightsgroups extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_lib/ncrightsgroups', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $site) {
if(!$site->getId()) {
$site->setCreatedAt(now());
}
$site->setUpdatedAt(now());
return parent::_beforeSave($site);
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Ncrightsgroups_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_lib/ncrightsgroups');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Timetable extends Mage_Core_Model_Mysql4_Abstract {
protected function _construct() {
$this->_init('anc_lib/timetable', 'entity_id');
}
protected function _beforeSave(Mage_Core_Model_Abstract $site) {
if(!$site->getId()) {
$site->setCreatedAt(now());
}
$site->setUpdatedAt(now());
return parent::_beforeSave($site);
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Resource_Mysql4_Timetable_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
public function _construct(){
$this->_init('anc_lib/timetable');
parent::_construct();
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Timetable extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/timetable');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Model_Timetable extends Mage_Core_Model_Abstract {
protected function _construct()
{
parent::_construct();
$this->_init('anc_lib/timetable');
}
}
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Adminhtml_NcrightsController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$rightsBlock = $this->getLayout()->createBlock('anc_lib/adminhtml_ncrights');
$this->loadLayout()
->_addContent($rightsBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_lib/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$id = $this->getRequest()->getParam('id');
// if (!$id){
// $id=2;
// }
$model = Mage::getModel('anc_lib/ncrights')->load($id);
if ($model->getId() || $id == 0) {
Mage::register('anc_lib', $model);
$this->loadLayout();
$this->_setActiveMenu('test/set_time');
$this->_addBreadcrumb('test Manager', 'test Manager');
$this->_addBreadcrumb('Test Description', 'Test Description');
$this->getLayout()->getBlock('head')
->setCanLoadExtJs(true);
$this->_addContent($this->getLayout()
->createBlock('anc_lib/adminhtml_ncrights_edit'))
->_addLeft($this->getLayout()
->createBlock('anc_lib/adminhtml_ncrights_edit_tabs')
);
$this->renderLayout();
} else {
Mage::getSingleton('adminhtml/session')
->addError('Test does not exist');
$this->_redirect('*/*/');
}
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
$return_self = false;
try {
$postData = $this->getRequest()->getPost();
D::s($postData, '$postDataRights', 5, 1);
$testModel = Mage::getModel('anc_lib/ncrights');
if ($this->getRequest()->getParam('id') <= 0)
$return_self = true;
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
// D::s($testModel->getData('entity_id'),'entity_id',5,1);
if ($postData['albumid'] > 0) {
$param_where = array("entity_id" => $postData['albumid']); //$postData['albumid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_album_ncalbum', 'ncright_id', $testModel->getData('entity_id'), $param_where);
if ($this->getRequest()->getParam('back')) {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
'albumid' => $postData['albumid']
)
);
return;
}
if ($return_self === true) {
$this->_redirect('*/adminhtml_ncrights/edit', array('id' => $testModel->getData('entity_id'), 'albumid' => $postData['albumid']));
} else {
$this->_redirect('album/adminhtml_album/edit', array('id' => $postData['albumid']));
}
return;
} else if ($postData['imageid'] > 0) {
// D::s(imageid);
$param_where = array("entity_id" => $postData['imageid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_image_ncimage', 'ncright_id', $testModel->getData('entity_id'), $param_where);
if ($this->getRequest()->getParam('back')) {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
'imageid' => $postData['imageid']
)
);
return;
}
if ($return_self === true) {
$this->_redirect('*/adminhtml_ncrights/edit', array('id' => $testModel->getData('entity_id'), 'imageid' => $postData['imageid']));
} else {
$this->_redirect('image/adminhtml_image/edit', array('id' => $postData['imageid']));
}
return;
} else if ($postData['textid'] > 0) {
$param_where = array("entity_id" => $postData['textid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_text_nctext', 'ncright_id', $testModel->getData('entity_id'), $param_where);
if ($this->getRequest()->getParam('back')) {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
'textid' => $postData['textid']
)
);
return;
}
if ($return_self === true) {
$this->_redirect('*/adminhtml_ncrights/edit', array('id' => $testModel->getData('entity_id'), 'textid' => $postData['textid']));
} else {
$this->_redirect('text/adminhtml_text/edit', array('id' => $postData['textid']));
}
return;
} else if ($postData['playlistid'] > 0) {
$param_where = array("entity_id" => $postData['siteid']); //$postData['albumid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_site_ncsite', 'ncright_id', $testModel->getData('entity_id'), $param_where);
if ($this->getRequest()->getParam('back')) {
$this->_redirect(
'*/*/edit', array(
'id' => $testModel->getId(),
'siteid' => $postData['siteid']
)
);
return;
}
if ($return_self === true) {
$this->_redirect('*/adminhtml_ncrights/edit', array('id' => $testModel->getData('entity_id'), 'siteid' => $postData['siteid']));
} else {
$this->_redirect('site/adminhtml_site/edit', array('id' => $postData['siteid']));
}
return;
}
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_lib/ncrights');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('ncrights/form');
}
public function removeUserFromRightsAction() {
$varParam = $this->getRequest()->getParams();
$result = Mage::helper('anc_lib/sql')->deleteRow('anc_lib_ncrightscustomers', array('entity_id' => $varParam['entityid']));
if ($result) {
Mage::getSingleton('adminhtml/session')
->addSuccess('Datensatz wurde gelöscht');
}
$arrayurl = array();
$arrayurl['id'] = $varParam['rightsid'];
if ($varParam['albumid']) {
$arrayurl['albumid'] = $varParam['albumid'];
}
if ($varParam['imageid']) {
$arrayurl['imageid'] = $varParam['imageid'];
}
if ($varParam['textid']) {
$arrayurl['textid'] = $varParam['textid'];
}
if ($varParam['siteid']) {
$arrayurl['siteid'] = $varParam['siteid'];
}
$this->_redirect('*/*/edit', $arrayurl);
}
public function removeGroupFromRightsAction() {
$varParam = $this->getRequest()->getParams();
// Mage::helper('anc_lib/sql')->insertValuesIntoTable('anc_lib_ncrightsgroups', array('rights_id' => $var_params['rightid'], 'customer_group_id' => $var_params['groupid']));
$result = Mage::helper('anc_lib/sql')->deleteRow('anc_lib_ncrightsgroups', array('entity_id' => $varParam['entityid']));
if ($result) {
Mage::getSingleton('adminhtml/session')
->addSuccess('Datensatz wurde gelöscht');
}
$arrayurl = array();
$arrayurl['id'] = $varParam['rightsid'];
if ($varParam['albumid']) {
$arrayurl['albumid'] = $varParam['albumid'];
}
if ($varParam['imageid']) {
$arrayurl['imageid'] = $varParam['imageid'];
}
if ($varParam['textid']) {
$arrayurl['textid'] = $varParam['textid'];
}
if ($varParam['siteid']) {
$arrayurl['siteid'] = $varParam['siteid'];
}
$this->_redirect('*/*/edit', $arrayurl);
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Adminhtml_NcrightscustomersController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$rightsBlock = $this->getLayout()->createBlock('anc_lib/adminhtml_ncrightscustomers');
$this->loadLayout()
->_addContent($rightsBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_lib/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$var_params = $this->getRequest()->getParams();
D::s($var_params, 'entity_id', 5, 1);
$item_exists = Mage::helper('anc_lib/sql')->selectFetchOneRow('anc_lib_ncrightscustomers', array('rights_id' => $var_params['rightid'], 'customer_id' => $var_params['userid']));
$arrayurl['rightid'] = $var_params['rightid'];
$arrayurl['id'] = $var_params['rightid'];
if ($var_params['albumid']) {
$arrayurl['albumid'] = $var_params['albumid'];
}
if ($var_params['imageid']) {
$arrayurl['imageid'] = $var_params['imageid'];
}
if ($var_params['textid']) {
$arrayurl['textid'] = $var_params['textid'];
}
if ($var_params['siteid']) {
$arrayurl['siteid'] = $var_params['siteid'];
}
if (!$item_exists) {
Mage::helper('anc_lib/sql')->insertValuesIntoTable('anc_lib_ncrightscustomers', array('rights_id' => $var_params['rightid'], 'customer_id' => $var_params['userid']));
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
// $arrayurl['albumid'] = $var_params['albumid'];
//
$this->_redirect('*/*/list', $arrayurl);
// return;
} else {
Mage::getSingleton('adminhtml/session')
->addError('Benutzer existiert schon');
// $varurlcustomers = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl);
$this->_redirect('lib/adminhtml_ncrights/edit', $arrayurl);
// return;
}
$arrayurl = array();
if (TRUE) {
} else {
}
// $varurlcustomers = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl);
//
// $this->getUrl('*/*/edit', array('id' => $row->getId(),'rightid'=>$var_params['rightid']));
// $this->_redirect('lib/adminhtml_ncrights/edit',$arrayurl);
// }
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
D::s($postData, '$postDataRights', 5, 1);
$testModel = Mage::getModel('anc_lib/ncrightscustomers');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
D::s($testModel->getData('entity_id'), 'entity_id', 5, 1);
if ($postData['albumid'] > 0) {
$param_where = array("entity_id" => $postData['albumid']); //$postData['albumid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_album_ncalbum', 'ncright_id', $testModel->getData('entity_id'), $param_where);
$this->_redirect('*/*/list');
$this->_redirect('album/adminhtml_album/edit', array('id' => $postData['albumid']));
return;
}
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_lib/ncrightscustomers');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('ncrightscustomers/form');
}
public function customergridAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
public function customerAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Adminhtml_NcrightsgroupsController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$rightsBlock = $this->getLayout()->createBlock('anc_lib/adminhtml_ncrightsgroups');
$this->loadLayout()
->_addContent($rightsBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_lib/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$var_params = $this->getRequest()->getParams();
D::s($var_params, 'entity_id', 5, 1);
$item_exists = Mage::helper('anc_lib/sql')->selectFetchOneRow('anc_lib_ncrightsgroups', array('rights_id' => $var_params['rightid'], 'customer_group_id' => $var_params['groupid']));
$arrayurl['rightid'] = $var_params['rightid'];
$arrayurl['id'] = $var_params['rightid'];
if ($var_params['albumid']) {
$arrayurl['albumid'] = $var_params['albumid'];
}
if ($var_params['imageid']) {
$arrayurl['imageid'] = $var_params['imageid'];
}
if ($var_params['textid']) {
$arrayurl['textid'] = $var_params['textid'];
}
if ($var_params['siteid']) {
$arrayurl['siteid'] = $var_params['siteid'];
}
if (!$item_exists) {
Mage::helper('anc_lib/sql')->insertValuesIntoTable('anc_lib_ncrightsgroups', array('rights_id' => $var_params['rightid'], 'customer_group_id' => $var_params['groupid']));
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
// $arrayurl['rightid'] = $var_params['rightid'];
// $arrayurl['albumid'] = $var_params['albumid'];
$this->_redirect('*/*/list', $arrayurl);
// return;
} else {
Mage::getSingleton('adminhtml/session')
->addError('Benutzer existiert schon');
// $arrayurl['id'] = $var_params['rightid'];
// $arrayurl['albumid'] = $var_params['albumid'];
// $varurlcustomers = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl);
$this->_redirect('lib/adminhtml_ncrights/edit', $arrayurl);
// return;
}
$arrayurl = array();
if (TRUE) {
} else {
}
// $varurlcustomers = $this->getUrl('lib/adminhtml_ncrights/edit', $arrayurl);
//
// $this->getUrl('*/*/edit', array('id' => $row->getId(),'rightid'=>$var_params['rightid']));
// $this->_redirect('lib/adminhtml_ncrights/edit',$arrayurl);
// }
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
D::s($postData, '$postDataRights', 5, 1);
$testModel = Mage::getModel('anc_lib/ncrightsgroups');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
D::s($testModel->getData('customer_group_id'), 'customer_group_id', 5, 1);
if ($postData['albumid'] > 0) {
$param_where = array("entity_id" => $postData['albumid']); //$postData['albumid']);
Mage::helper('anc_lib/sql')->updateOneCell('anc_album_ncalbum', 'ncright_id', $testModel->getData('customer_group_id'), $param_where);
// $this->_redirect('*/*/list');
$this->_redirect('album/adminhtml_album/edit', array('id' => $postData['albumid']));
return;
}
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_lib/ncrightsgroups');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('ncrightsgroups/form');
}
public function customergridAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
public function customerAction() {
$this->loadLayout();
$this->getLayout()->getBlock('customer.grid')
->setCustomers($this->getRequest()->getPost('customers', null));
$this->renderLayout();
}
}
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class Anc_Lib_Adminhtml_TimetableController extends Mage_Adminhtml_Controller_Action {
// private static $customerid;
public function listAction() {
$timetableBlock = $this->getLayout()->createBlock('anc_lib/adminhtml_timetables');
$this->loadLayout()
->_addContent($timetableBlock)
->renderLayout();
}
protected function _initAction() {
$this->loadLayout()->_setActiveMenu('anc_lib/ANC')
->_addBreadcrumb('test Manager', 'test Manager');
return $this;
}
public function indexAction() {
$this->_initAction();
$this->renderLayout();
}
public function editAction() {
$id = $this->getRequest()->getParam('id');
$model = Mage::getModel('anc_lib/timetable')->load($id);
if ($model->getId() || $id == 0) {
Mage::register('anc_timetable', $model);
$this->loadLayout();
$this->_setActiveMenu('test/set_time');
$this->_addBreadcrumb('test Manager', 'test Manager');
$this->_addBreadcrumb('Test Description', 'Test Description');
$this->getLayout()->getBlock('head')
->setCanLoadExtJs(true);
$this->_addContent($this->getLayout()
->createBlock('anc_lib/adminhtml_timetables_edit'))
->_addLeft($this->getLayout()
->createBlock('anc_lib/adminhtml_timetables_edit_tabs')
);
$this->renderLayout();
} else {
Mage::getSingleton('adminhtml/session')
->addError('Test does not exist');
$this->_redirect('*/*/');
}
}
public function newAction() {
$this->_forward('edit');
}
public function saveAction() {
if ($this->getRequest()->getPost()) {
try {
$postData = $this->getRequest()->getPost();
$testModel = Mage::getModel('anc_lib/timetable');
if ($this->getRequest()->getParam('id') <= 0)
$testModel->setCreatedTime(
Mage::getSingleton('core/date')
->gmtDate()
);
$testModel
->addData($postData)
->setUpdateTime(
Mage::getSingleton('core/date')
->gmtDate())
->setId($this->getRequest()->getParam('id'))
->save();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully saved');
Mage::getSingleton('adminhtml/session')
->settestData(false);
$this->_redirect('*/*/list');
return;
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')
->settestData($this->getRequest()
->getPost()
);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()
->getParam('id')));
return;
}
}
$this->_redirect('*/*/');
}
public function deleteAction() {
if ($this->getRequest()->getParam('id') > 0) {
try {
$testModel = Mage::getModel('anc_lib/timetable');
$testModel->setId($this->getRequest()
->getParam('id'))
->delete();
Mage::getSingleton('adminhtml/session')
->addSuccess('successfully deleted');
$this->_redirect('*/*/');
$this->_redirect('*/*/list');
} catch (Exception $e) {
Mage::getSingleton('adminhtml/session')
->addError($e->getMessage());
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
}
}
$this->_redirect('*/*/list');
// $this->_redirect('*/*/');
}
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('lib/form');
}
}
<?xml version="1.0"?>
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<!-- <Anc_Anc module="anc_site">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<item2 module="anc_site">
<title>Playlists</title>
<sort_order>2</sort_order>
<action>site/adminhtml_site/index</action>
<children>
<item2b module="anc_lib">
<title>Timetables</title>
<sort_order>3</sort_order>
<action>lib/adminhtml_timetable/list</action>
</item2b>
</children>
</item2>
</children>
</Anc_Anc>-->
<system>
<children>
<config>
<children>
<site translate="title">
<title>Lib</title>
<sort_order>101</sort_order>
</site>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config>
<modules>
<Anc_Lib>
<version>0.1.0</version>
</Anc_Lib>
</modules>
<global>
<models>
<anc_lib>
<class>Anc_Lib_Model</class>
<resourceModel>anc_lib_resource</resourceModel>
</anc_lib>
<anc_lib_resource>
<class>Anc_Lib_Model_Resource_Mysql4</class>
<!-- entitie's mit s hier können mehrere Tabellen(namen) untergebracht werden -->
<entities>
<timetable>
<table>anc_lib_timetable</table>
</timetable>
<ncrights>
<table>anc_lib_ncrights</table>
</ncrights>
<ncrightscustomers>
<table>anc_lib_ncrightscustomers</table>
</ncrightscustomers>
<ncrightsgroups>
<table>anc_lib_ncrightsgroups</table>
</ncrightsgroups>
</entities>
</anc_lib_resource>
</models>
<resources>
<!-- hier verbirgt sich das installationsskript um die datenbanktabellen zu erstellen -->
<anc_lib_setup>
<setup>
<module>Anc_Lib</module>
<class>Mage_Sales_Model_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</anc_lib_setup>
<!-- datenbank verbindungen -->
<anc_lib_write>
<connection>
<use>core_write</use>
</connection>
</anc_lib_write>
<anc_lib_read>
<connection>
<use>core_read</use>
</connection>
</anc_lib_read>
</resources>
<blocks>
<anc_lib>
<class>Anc_Lib_Block</class>
</anc_lib>
<anc_lib_adminhtml>
<class>Anc_Lib_Block_Adminhtml</class>
</anc_lib_adminhtml>
<customer>
<rewrite>
<account_navigation>Anc_Lib_Block_Account_Navigation</account_navigation>
</rewrite>
</customer>
</blocks>
<helpers>
<anc_lib>
<class>Anc_Lib_Helper</class>
</anc_lib>
</helpers>
</global>
<admin>
<routers>
<anc_lib>
<use>admin</use>
<args>
<module>Anc_Lib</module>
<frontName>lib</frontName>
</args>
</anc_lib>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<lib>
<file>anc/lib.xml</file>
</lib>
</updates>
</layout>
<menu>
<!-- <Anc_Anc module="anc_lib">
<title>ANC</title>
<sort_order>71</sort_order>
<children>
<item2 module="anc_lib">
<title>Playlists</title>
<sort_order>2</sort_order>
<action>site/adminhtml_playlist/list</action>
<children>
<item2b module="anc_lib">
<title>Timetables</title>
<sort_order>3</sort_order>
<action>lib/adminhtml_timetable/list</action>
</item2b>
</children>
</item2>
</children>
</Anc_Anc>-->
</menu>
</adminhtml>
</config>
\ No newline at end of file
<?php
/**
* @package anc_lib
* @category magento
* @mailto code [at] netz.coop
* @author netz.coop eG*
* @copyright (c) 2014, netz.coop eG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* @var Mage_Sales_Model_Mysql4_Setup $installer
*/
$installer = $this;
$installer->startSetup();
$tableName = $installer->getTable('anc_lib/timetable');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Name')
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'comment')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0',), 'Who Created frontend')
->addColumn('start', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'Start Date as Timestamp')
->addColumn('stop', Varien_Db_Ddl_Table::TYPE_TIMESTAMP,null,array(),'End Date as Timestamp')
->addColumn('starthour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Hour')
->addColumn('stophour', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '23'),'Daily stop Hour')
->addColumn('startmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '0'),'Daily start Min')
->addColumn('stopmin', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('default' => '59'),'Daily stop Min')
->addColumn('monday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Mondays')
->addColumn('tuesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Tuesday')
->addColumn('wednesday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Wednesday')
->addColumn('thursday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Thursday')
->addColumn('friday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Friday')
->addColumn('saturday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Saturday')
->addColumn('sunday', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, array('default' => '1'), 'Runs Sunday')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$tableName = $installer->getTable('anc_lib/ncrights');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'Name')
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(), 'comment')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$tableName = $installer->getTable('anc_lib/ncrightscustomers');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('rights_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,), 'Rights Id')
->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,), 'Customer Id')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$tableName = $installer->getTable('anc_lib/ncrightsgroups');
if ($installer->getConnection()->isTableExists($tableName) != true) {
$table = $installer->getConnection()->newTable($tableName)
->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true,), 'Id')
->addColumn('rights_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,), 'Rights Id')
->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true,), 'Group Id')
->addColumn('admin_user_id', Varien_Db_Ddl_Table::TYPE_INTEGER,null,array('unsigned' => true,'nullable' => false,'default' => '0',),'Who Created backend')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When beginn')
->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'When updated')
->addColumn('deleted', Varien_Db_Ddl_Table::TYPE_TINYINT, null, array('default' => '0'), 'Deleted')
;
$installer->getConnection()->createTable($table);
}
$installer->endSetup();
//
//
//
?>
<?php $Breadcrumbs = Mage::helper('anc_lib/data')->getBreadcrumbs(); ?>
<div class="ncbreadcrumbs">
<?php $firstelement = true; ?>
<?php foreach($Breadcrumbs as $value): ?>
<div class="<?php if($firstelement) { echo 'firstelement'; $firstelement = false; } ?>" >
<?php if($value['readonly']): ?>
<?php echo $value['label']; ?>
<?php else: ?>
<a href="<?php echo $value['link']; ?>" title="<?php echo $value['title']; ?>">
<?php echo $value['label']; ?>
</a>
<?php endif; ?>
</div>
<?php if(!$value['last']): ?>
<div class=""> -> </div>
<?php endif; ?>
<?php endforeach; ?>
</div>
\ No newline at end of file
<?php $buttonTitle = 'To Cart'; ?>
<?php $backurl = '/checkout/cart/'; ?>
<button type="button" title="<?php echo $this->__($buttonTitle) ?>" class="button btn-cart" onclick="setLocation('<?php echo $backurl; ?>')"><?php echo $this->__($buttonTitle) ?></button>
\ No newline at end of file
<?xml version="1.0"?>
<config>
<modules>
<Anc_Lib>
<active>true</active>
<codePool>local</codePool>
</Anc_Lib>
</modules>
</config>
\ No newline at end of file
/**
* @copyright (c) 2014, netz.coop eG
*/
////Anc_Lib_Croppic = function() {
//
//}
function Anc_Lib_Croppic(element_croparea, options) {
// Croppic.call(this, id, options);
var that = this;
// that.id = id;
// that.obj = jQuery('#' + id);
// that.obj = jQuery(id);
that.obj = element_croparea;
that.outputDiv = that.obj;
// DEFAULT OPTIONS
that.options = {
uploadUrl:'',
uploadData:{},
cropUrl:'',
cropData:{},
outputUrlId:'',
//styles
imgEyecandy:true,
imgEyecandyOpacity:0.2,
zoomFactor:10,
doubleZoomControls:true,
modal:false,
customUploadButtonId:'',
loaderHtml:'',
//callbacks
onBeforeImgUpload: null,
onAfterImgUpload: null,
onImgDrag: null,
onImgZoom: null,
onBeforeImgCrop: null,
onAfterImgCrop: null
};
// OVERWRITE DEFAULT OPTIONS
for (i in options) that.options[i] = options[i];
// INIT THE WHOLE DAMN THING!!!
that.init();
}
Anc_Lib_Croppic.prototype = new Croppic;
Anc_Lib_Croppic.prototype.initialWithValues = function(param_cropdata) {
var that = this;
that_img_css = {
'top': '-'+param_cropdata.imgY1+'px',
'left': '-'+param_cropdata.imgX1+'px',
'width': param_cropdata.imgW+'px',
'height': param_cropdata.imgH+'px',
'z-index': 'auto',
}
that.img.css(that_img_css);
that_imgEyecandy_css = {
'top': '-'+param_cropdata.imgY1+'px',
'left': '-'+param_cropdata.imgX1+'px',
'width': param_cropdata.imgW+'px',
'height': param_cropdata.imgH+'px',
'z-index': '0',
'opacity': '0.2'
}
that.imgEyecandy.css(that_imgEyecandy_css);
cropImgWrapper_css = {
width: Math.round(param_cropdata.cropW) +'px',
height: Math.round(param_cropdata.cropH) +'px',
}
jQuery('> .cropImgWrapper', that.obj).css(cropImgWrapper_css);
that.cropH = param_cropdata.cropH;
that.cropW = param_cropdata.cropW;
that.imgH = param_cropdata.imgH;
that.imgW = param_cropdata.imgW;
that.imgInitH = param_cropdata.imgInitH;
that.imgInitW = param_cropdata.imgInitW;
that.imgX1 = param_cropdata.imgX1;
that.imgY1 = param_cropdata.imgY1;
};
Anc_Lib_Croppic.prototype.bindImgUploadControl = function(){
var that = this;
that.showLoader();
that.imgUploadControl.hide();
response = {};
response.status='success';
response.url = that.options.imageUrl;
response.height=that.options.imageHeight;
response.width=that.options.imageWidth;
console.log('response.url: '+response.url);
console.log('response.height: '+response.height);
console.log('response.width: '+response.width);
if(response.status=='success'){
that.imgInitW = that.imgW = response.width;
that.imgInitH = that.imgH = response.height;
if(that.options.modal){ that.createModal(); }
if( !jQuery.isEmptyObject(that.croppedImg)){ that.croppedImg.remove(); }
that.imgUrl=response.url;
that.obj.append('<img src="'+response.url+'">');
that.initCropper();
that.hideLoader();
if (that.options.onAfterImgUpload) that.options.onAfterImgUpload.call(that);
}
if(response.status=='error'){
that.obj.append('<p style="width:100%; height:100%; text-align:center; line-height:'+that.objH+'px;">'+response.message+'</p>');
that.hideLoader();
setTimeout( function(){ that.reset(); },2000)
}
console.log('Anc_Lib_Croppic.prototype.bindImgUploadControl');
}
Anc_Lib_Croppic.prototype.crop = function(){
var that = this;
if (that.options.onBeforeImgCrop) that.options.onBeforeImgCrop.call(that);
that.showLoader();
var cropData = {
imgUrl:that.imgUrl,
imgInitW:that.imgInitW,
imgInitH:that.imgInitH,
imgW:that.imgW,
imgH:that.imgH,
imgY1:Math.abs( parseInt( that.img.css('top') ) ),
imgX1:Math.abs( parseInt( that.img.css('left') ) ),
cropH:that.objH,
cropW:that.objW
};
return cropData;
}
Anc_Lib_Croppic.prototype.createCropControls = function() {
var that = this;
var cropControlZoomMuchIn = '<i class="cropControlZoomMuchIn"></i>';
var cropControlZoomMuchOut = '<i class="cropControlZoomMuchOut"></i>';
var html;
html = '<div class="cropControls cropControlsCrop">'+ cropControlZoomMuchOut + cropControlZoomMuchIn + '</div>';
that.obj.append(html);
that.cropControlsCrop = that.obj.find('.cropControlsCrop');
// CACHE AND BIND CONTROLS
if(that.options.doubleZoomControls){
that.cropControlZoomMuchIn = that.cropControlsCrop.find('.cropControlZoomMuchIn');
that.cropControlZoomMuchIn.on('click',function(){ that.zoom( that.options.zoomFactor*10 ); });
that.cropControlZoomMuchOut = that.cropControlsCrop.find('.cropControlZoomMuchOut');
that.cropControlZoomMuchOut.on('click',function(){ that.zoom(-that.options.zoomFactor*10); });
}
}
\ No newline at end of file
see full documentation at http://www.croppic.net/
works in IE 10+, chrome, and ffx (opera coming soon)
Uses FormData so no IE9 and prev versions support. feel free to extend with ie9 support
MIT LICENCE
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
#croppic{
width: 400px; /* MANDATORY */
height: 208px; /* MANDATORY */
position: relative; /* MANDATORY */
margin: 50px 70px 20px;
border: 3px solid #FFF;
box-sizing: content-box;
-moz-box-sizing: content-box;
border-radius: 2px;
background-image: url(../img/placeholder.png);
background-repeat: no-repeat;
background-position: center;
box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
}
/* DO NOT CHANGE FROM HERE ( unless u know what u are doing) */
.cropImgWrapper{
cursor: -webkit-grab;
cursor: grab;
}
.cropImgWrapper:active{
cursor: -webkit-grabbing;
cursor: grabbing;
}
.cropImgUpload{
z-index:2;
position:absolute;
height:28px;
display:block;
top: -30px;
right: -2px;
font-family:sans-serif;
width:20px;
height:20px;
text-align:center;
line-height:20px;
color:#FFF;
}
.cropControls{
z-index:2;
position:absolute;
height:30px;
display:block;
/* top: -31px; */
top: -1px;
right: -1px;
font-family:sans-serif;
background-color:rgba(0,0,0,0.35);
}
.cropControls i{
display:block;
float:left;
margin:0;
cursor:pointer;
background-image:url('../img/cropperIcons.png');
width:30px;
height:30px;
text-align:center;
line-height:20px;
color:#FFF;
font-size:13px;
font-weight: bold;
font-style: normal;
}
.cropControls i:hover{ background-color:rgba(0,0,0,0.7); }
.cropControls i.cropControlZoomMuchIn{ background-position:0px 0px;}
.cropControls i.cropControlZoomIn{ background-position:-30px 0px; }
.cropControls i.cropControlZoomOut{ background-position:-60px 0px; }
.cropControls i.cropControlZoomMuchOut{ background-position:-90px 0px; }
.cropControls i.cropControlCrop{ background-position:-120px 0px;}
.cropControls i.cropControlUpload{ background-position:-150px 0px;}
.cropControls i.cropControlReset{ background-position:-180px 0px;}
.cropControls i.cropControlRemoveCroppedImage{ background-position:-180px 0px;}
.cropControls i:last-child{
margin-right:none;
}
#croppicModal{
position:fixed;
width:100%;
height:100%;
top: 0;
left: 0;
display:block;
background:rgba(0,0,0,0.8);
z-index: 10000;
}
/*
* PRELOADER
* With courtesy of : http://cssload.net/
*/
.bubblingG {
text-align: center;
width:80px;
height:50px;
position: absolute;
top: 50%;
left: 50%;
margin: -18px auto auto -40px;
z-index:2;
}
.bubblingG span {
display: inline-block;
vertical-align: middle;
width: 10px;
height: 10px;
margin: 25px auto;
background: #FFF;
box-shadow: 5px 5px 0px rgba(0,0,0,0.2);
-moz-border-radius: 50px;
-moz-animation: bubblingG 1s infinite alternate;
-webkit-border-radius: 50px;
-webkit-animation: bubblingG 1s infinite alternate;
-ms-border-radius: 50px;
-ms-animation: bubblingG 1s infinite alternate;
-o-border-radius: 50px;
-o-animation: bubblingG 1s infinite alternate;
border-radius: 50px;
animation: bubblingG 1s infinite alternate;
}
#bubblingG_1 {
-moz-animation-delay: 0s;
-webkit-animation-delay: 0s;
-ms-animation-delay: 0s;
-o-animation-delay: 0s;
animation-delay: 0s;
}
#bubblingG_2 {
-moz-animation-delay: 0.3s;
-webkit-animation-delay: 0.3s;
-ms-animation-delay: 0.3s;
-o-animation-delay: 0.3s;
animation-delay: 0.3s;
}
#bubblingG_3 {
-moz-animation-delay: 0.6s;
-webkit-animation-delay: 0.6s;
-ms-animation-delay: 0.6s;
-o-animation-delay: 0.6s;
animation-delay: 0.6s;
}
@-moz-keyframes bubblingG {
0% {
width: 10px;
height: 10px;
background-color:#FFF;
-moz-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
background-color:#FFF;
-moz-transform: translateY(-21px);
}
}
@-webkit-keyframes bubblingG {
0% {
width: 10px;
height: 10px;
background-color:#FFF;
-webkit-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
background-color:#FFF;
-webkit-transform: translateY(-21px);
}
}
@-ms-keyframes bubblingG {
0% {
width: 10px;
height: 10px;
background-color:#FFF;
-ms-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
background-color:#FFF;
-ms-transform: translateY(-21px);
}
}
@-o-keyframes bubblingG {
0% {
width: 10px;
height: 10px;
background-color:#FFF;
-o-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
background-color:#FFF;
-o-transform: translateY(-21px);
}
}
@keyframes bubblingG {
0% {
width: 10px;
height: 10px;
background-color:#FFF;
transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
background-color:#FFF;
transform: translateY(-21px);
}
}
/* some reset stlyes */
/*
* Author: Carlos Alvarez
* URL: http://alvarez.is
*
* Project Name: FLATTY - Free Bootstrap 3 Theme
* Version: 1.0
* URL: http://blacktie.co
*/
body {
background-color: #f2f2f2;
font-family: 'Lato', sans-serif;
font-weight: 300;
font-size: 16px;
color: #555;
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
}
/* Titles */
h1, h2, h3, h4, h5, h6 {
font-family: 'Lato', sans-serif;
font-weight: 300;
color: #333;
}
h1 {
font-size: 40px;
}
h3 {
color: #95a5a6;
font-weight: 400;
}
h4 {
color: #95a5a6;
font-weight: 400;
font-size: 20px;
}
/* Paragraph & Typographic */
p {
line-height: 28px;
margin-bottom: 25px;
font-size: 16px;
}
.centered {
text-align: center;
}
/* Links */
a {
color: #3498db;
word-wrap: break-word;
-webkit-transition: color 0.1s ease-in, background 0.1s ease-in;
-moz-transition: color 0.1s ease-in, background 0.1s ease-in;
-ms-transition: color 0.1s ease-in, background 0.1s ease-in;
-o-transition: color 0.1s ease-in, background 0.1s ease-in;
transition: color 0.1s ease-in, background 0.1s ease-in;
}
a:hover,
a:focus {
color: #7b7b7b;
text-decoration: none;
outline: 0;
}
a:before,
a:after {
-webkit-transition: color 0.1s ease-in, background 0.1s ease-in;
-moz-transition: color 0.1s ease-in, background 0.1s ease-in;
-ms-transition: color 0.1s ease-in, background 0.1s ease-in;
-o-transition: color 0.1s ease-in, background 0.1s ease-in;
transition: color 0.1s ease-in, background 0.1s ease-in;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 70px 0 70px;
padding: 0;
}
.navbar-default {
background-color: #FFF;
border-color: transparent;
}
.nav.navbar-nav.navbar-right{
margin-top:10px;
font-size: 17px;
}
.nav.navbar-nav.navbar-right > li > a{
padding:15px 30px;
cursor:pointer;
}
.navbar-default .navbar-brand {
color: white;
}
.navbar-default .navbar-nav > li > a {
color: #000;
}
/* Helpers */
.mt {
margin-top: 40px;
margin-bottom: 40px;
}
.form-control {
height: 42px;
font-size: 18px;
width: 280px;
}
i {
margin: 8px;
color: #3498db;
}
.logo{
font-family: 'Mrs Sheppards', cursive;
font-size: 31px;
line-height: 31px;
margin: 0px 0 7px;
color: #333;
}
/* HeaderWrap */
#headerwrap {
background-color: #52B1E7;
margin-top:68px;
background-attachment: relative;
background-position: center center;
min-height: 430px;
width: 100%;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-image:url(../img/headerBg.jpg);
background-attachment:fixed;
}
.logoHeader{
font-family: 'Mrs Sheppards', cursive;
font-size: 145px;
line-height: 31px;
margin: 105px 0 7px;
color: #FFF;
display: block;
position: relative;
z-index: 1;
text-shadow: 8px 8px 0px rgba(0,0,0,0.1);
text-align: center;
width: 430px;
}
#headerwrap h2 {
margin-top: 82px;
margin-bottom: 28px;
opacity: 0.8;
color: rgb(255, 255, 255);
font-size: 33px;
text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
text-align: center;
width: 430px;
font-weight: 300;
letter-spacing: 1px;
}
.logoImg{
width: 130px;
margin: 0 145px 7px;
}
.downloadButton{
color: #FFFFFF;
margin: 10px 10px;
padding: 20px 50px;
width: 408px;
display: none;
text-align: center;
font-weight: 300;
background: transparent;
border-radius: 3px;
font-size: 38px;
}
.downloadButton sup{
font-family: 'Lato', sans-serif;
font-size:15px;
}
.cropHeaderWrapper{
overflow:hidden;
height: 420px;
}
#cropContainerHeaderButton{
color: #FFF;
margin: 10px 0 30px 71px;
padding: 15px 50px;
width: 407px;
display: block;
text-align: center;
font-weight: 400;
background: #2CE987;
text-transform: uppercase;
border-radius: 2px;
box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
font-size: 20px;
}
#cropContainerHeaderButton:hover {
background: #1CD139;
}
.optionsDiv{
border-radius:2px;
position:absolute;
}
.optionsDiv a{
width:50%;
margin-right:20%;
float:left;
margin-bottom:10px;
cursor:pointer;
}
#optionsFloating.fixed{
position:fixed;
top:100px;
}
.downloadLink{
font-size: 22px;
color: #666;
text-align: center;
display: block;
width: 320px;
width: 320px;
padding: 10px;
border: 1px solid #CCC;
height: 62px;
margin: 0 auto;
}
.downloadLink:hover {
background:#FFF;
}
.downloadIcon{
width:75px;
height:75px;
display:block;
background-size:75px 150px;
background-position:0px 0px;
background-image: url(../img/downloadIcon.png);
}
.downloadLink:hover .downloadIcon{
background-position:0px -75px;
}
.downloadIcon.small{
width:25px;
height:25px;
display:block;
background-size:25px 50px;
background-position:0px 0px;
background-image: url(../img/downloadIcon.png);
}
.downloadLink:hover .downloadIcon.small{
background-position:0px -25px;
}
.downloadLink .downloadIcon {
float:left;
}
.downloadLink span{
line-height: 40px;
float:left;
}
#cropContainerModal{ width:100%; height:200px; position: relative; border:1px solid #ccc;}
#cropContaineroutput{ width:100%; height:145px; position: relative; border:1px solid #ccc;}
#cropContainerEyecandy{ width:100%; height:200px; position: relative; border:1px solid #ccc;}
#web_by {position:absolute; right:10px; font-size:10px; color:#aaa; padding:13px; cursor:pointer; }
#web_by label{ display:none; position:absolute; right:5px; top:-32px; z-index:10000; font-size:10px; color:#ffa200; padding:10px 9px; cursor:pointer; width:60px; height:40px; background-image:url('../img/jobotic_bubble.png'); background-repeat:no-repeat; }
#jobotic {position:fixed; right:-100px; bottom:-3px; font-size:10px; color:#aaa; padding:13px; cursor:pointer; z-index:9999;}
#kontakt { float:left; width:100%; height:auto; z-index:450; position:relative; }
#kontakt_bg { position:absolute; top:0; left:0; width:100%; height:auto; z-index:450;}
#copyright {float:left; width:100%; height:45px; background-color:#FFF; margin-top:6px;}
#copyright p{float:left; width:100%; font-size:12px; color:#999; text-align:center; background-color:#FFF; margin-top:10px;}
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!