Exemplo n.º 1
0
					</td>
                    <td class='filter'>
		    			<?php 
echo input_tag('filters[CODE]', isset($filters['CODE']) ? $filters['CODE'] : null, array('size' => 12));
?>
		  			</td>
		 			<td class='filter'>
		    			<?php 
echo input_tag('filters[NAME]', isset($filters['NAME']) ? $filters['NAME'] : null, array('size' => 25));
?>
		 			</td>
					<td class='filter'>
					<?php 
echo input_hidden_tag('filters[COL_ITEM_ID]', isset($filters['COL_ITEM_ID']) ? $filters['COL_ITEM_ID'] : null);
if (isset($filters['COL_ITEM_ID']) && $filters['COL_ITEM_ID']) {
    echo input_auto_complete_tag('index', isset($filters['COL_ITEM_ID']) && $filters['COL_ITEM_ID'] ? ColItemPeer::retrieveByPk($filters['COL_ITEM_ID'])->getIndexNo() : '', '/col_item/getIndex', array('size' => 20), array('after_update_element' => 'function(f, s) {$("COL_ITEM_ID").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
} else {
    echo input_auto_complete_tag('index', null, '/col_item/getIndex', array('size' => 20), array('after_update_element' => 'function(f, s) {$("filters_COL_ITEM_ID").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 1));
}
?>
						<?php 
#echo object_select_tag(isset($filters['col_item_id']) ? $filters['col_item_id'] : null, null, array ( 'include_blank' => true, 'related_class' => 'ColItem', 'text_method' => '__toString', 'control_name' => 'filters[col_item_id]', 'style'=>"width: 80px;", ))
?>
					</td>
					<!-- 
                    <td class='filter'>
						<?php 
#echo object_select_tag(isset($filters['col_status_id']) ? $filters['col_status_id'] : null, null, array ( 'include_blank' => true, 'related_class' => 'ColStatus', 'text_method' => '__toString', 'control_name' => 'filters[col_status_id]', ))
?>
					</td>
                    -->
Exemplo n.º 2
0
 public function executeGetLabel()
 {
     $col_item = ColItemPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($col_item);
     $this->col_item = $col_item;
     define('IMG_FORMAT_PNG', 1);
     define('IMG_FORMAT_JPEG', 2);
     define('IMG_FORMAT_WBMP', 4);
     define('IMG_FORMAT_GIF', 8);
     require 'FColor.php';
     require 'BarCode.php';
     require 'FDrawing.php';
     include 'code128.barcode.php';
     $color_black = new FColor(0, 0, 0);
     $color_white = new FColor(255, 255, 255);
     $code_generated = new code128(32, $color_black, $color_white, 1, $col_item->toString(), 3);
     $drawing = new FDrawing(1024, 1024, '', $color_white);
     $drawing->init();
     $drawing->add_barcode($code_generated);
     $drawing->draw_all();
     $im = $drawing->get_im();
     $im2 = imagecreate($code_generated->lastX, $code_generated->lastY);
     imagecopyresized($im2, $im, 0, 0, 0, 0, $code_generated->lastX, $code_generated->lastY, $code_generated->lastX, $code_generated->lastY);
     $drawing->set_im($im2);
     $drawing->finish(IMG_FORMAT_PNG);
 }
Exemplo n.º 3
0
 public function executeDeleteItem()
 {
     $col_item = ColItemPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($col_item);
     $col_item->delete();
     return $this->redirect('collection/listItem?catalog_id=' . $this->getRequestParameter('catalog_id'));
 }
Exemplo n.º 4
0
 public function executeOrderMember()
 {
     $this->returnModule = 'catalog';
     $this->returnAction = 'showMemberNondigital?id=' . $this->getRequestParameter('catalog_id');
     $member_id = $this->getUser()->getAttribute('user_id', null, 'bo');
     $member = MemberPeer::retrieveByPK($member_id);
     $id = $this->getRequestParameter('id');
     $item = ColItemPeer::retrieveByPk($id);
     $this->forward404Unless($item);
     $this->forward404Unless($member);
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(CirRegulationPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->add(CirRegulationPeer::MEMBER_TYPE_ID, $member->getType());
     $c->add(CirRegulationPeer::CAT_CATEGORY_ID, $item->getCatalog()->getCatCategoryId());
     $regulation = CirRegulationPeer::doSelectOne($c);
     if (!$regulation) {
         $this->forward($this->returnModule, $this->returnAction);
     }
     $c = new Criteria();
     $c->add(CirHistoryPeer::MEMBER_ID, $member->getId());
     $c->add(CirHistoryPeer::RETURN_DATE, null);
     $c->addJoin(CirHistoryPeer::COL_ITEM_ID, ColItemPeer::ID);
     $c->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID);
     $c->add(CatalogPeer::CAT_CATEGORY_ID, $regulation->getCatCategoryId());
     $cir_hist_array = CirHistoryPeer::doSelect($c);
     $this->subtitle = '&nbsp;' . $item->toString() . ' - judul:' . $item->getCatalog()->getTitle() . ' (' . $item->getId() . ')';
     $this->member = $member;
     $this->item = $item;
     $this->regulation = $regulation;
     $this->can_loan = true;
     $this->max_loan_limit = false;
     if ($regulation->getCanLoan() !== true) {
         $this->can_loan = false;
     }
     if ($regulation->getMaxLoan() <= count($cir_hist_array)) {
         $this->max_loan_limit = true;
     }
 }
Exemplo n.º 5
0
 public function executeList2()
 {
     $this->can_add = 0;
     $this->can_edit = 0;
     $this->can_remove = 0;
     $col_item = ColItemPeer::retrieveByPk($this->getRequestParameter('col_item_id'));
     $member = MemberPeer::retrieveByPk($this->getRequestParameter('member_id'));
     $this->forward404Unless($col_item || $member);
     $c = new Criteria();
     if ($col_item) {
         $c->add(VCirHistoryMemberPeer::COL_ITEM_ID, $col_item->getId());
     }
     if ($member) {
         $c->add(VCirHistoryMemberPeer::MEMBER_ID, $member->getId());
     }
     $this->sort($c);
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if (is_array($f)) {
                     if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
                         $defined_filter = true;
                         break;
                     }
                 } else {
                     if ($f != null && $f != '') {
                         $defined_filter = true;
                         break;
                     }
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'cir_history'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'cir_history');
     $pager = new sfPropelPager('VCirHistoryMember', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'cir_history'));
     $this->getUser()->setAttribute('page', $page, 'cir_history');
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
     $this->col_item = $col_item;
     $this->member = $member;
     $this->col_item_id = $this->getRequestParameter('col_item_id');
     $this->member_id = $this->getRequestParameter('member_id');
 }
Exemplo n.º 6
0
 public function executeOrder()
 {
     $this->returnModule = 'catalog';
     $this->returnAction = 'listItem';
     $this->_title = 'LoanOrder';
     $member = MemberPeer::retrieveByCode($this->getRequestParameter('code'));
     $id = $this->getRequestParameter('id');
     $item = ColItemPeer::retrieveByPk($id);
     $this->forward404Unless($item);
     $this->forward404Unless($member);
     $c = new Criteria();
     #$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(CirRegulationPeer::DEPARTMENT_ID, $item->getColLocation()->getDepartmentId());
     $c->add(CirRegulationPeer::MEMBER_TYPE_ID, $member->getType());
     $c->add(CirRegulationPeer::CAT_CATEGORY_ID, $item->getCatalog()->getCatCategoryId());
     $regulation = CirRegulationPeer::doSelectOne($c);
     if (!$regulation) {
         $this->forward($this->returnModule, $this->returnAction);
     }
     $c = new Criteria();
     $c->add(CirHistoryPeer::MEMBER_ID, $member->getId());
     $c->add(CirHistoryPeer::RETURN_DATE, null);
     $c->addJoin(CirHistoryPeer::COL_ITEM_ID, ColItemPeer::ID);
     $c->addJoin(ColItemPeer::CATALOG_ID, CatalogPeer::ID);
     $c->add(CatalogPeer::CAT_CATEGORY_ID, $regulation->getCatCategoryId());
     $cir_hist_array = CirHistoryPeer::doSelect($c);
     $this->member = $member;
     $this->item = $item;
     $this->regulation = $regulation;
     $this->can_loan = true;
     $this->max_loan_limit = false;
     if ($regulation->getCanLoan() !== true) {
         $this->can_loan = false;
     }
     if ($regulation->getMaxLoan() <= count($cir_hist_array)) {
         $this->max_loan_limit = true;
     }
 }