Пример #1
0
 public static function cloneSequence($sequode_model_id = 0)
 {
     if (!(\Sequode\Application\Modules\Account\Authority::canCreate() && \Sequode\Application\Modules\Sequode\Modeler::exists($sequode_model_id, 'id') && \Sequode\Application\Modules\Sequode\Authority::isSequence() && \Sequode\Application\Modules\Account\Authority::canCopy())) {
         return;
     }
     \Sequode\Application\Modules\Sequode\Operations::makeSequenceCopy(\Sequode\Application\Modules\Account\Modeler::model()->id);
     $object = (object) null;
     $object->Success = 1;
     $object->Model_Id = \Sequode\Application\Modules\Sequode\Modeler::model()->id;
     echo json_encode($object);
     exit;
 }
Пример #2
0
 public static function cloneSequence($_model_id)
 {
     $module = static::$module;
     $modeler = $module::model()->modeler;
     $operations = $module::model()->operations;
     $xhr_cards = $module::model()->xhr->cards;
     if (!(\Sequode\Application\Modules\Account\Authority::canCreate() && $modeler::exists($_model_id, 'id') && \Sequode\Application\Modules\Sequode\Authority::isSequence() && \Sequode\Application\Modules\Account\Authority::canCopy())) {
         return;
     }
     forward_static_call_array(array($operations, 'makeSequenceCopy'), array(\Sequode\Application\Modules\Account\Modeler::model()->id));
     $js = array();
     $collection = 'sequodes';
     $js[] = DOMElementKitJS::fetchCollection($collection, $modeler::model()->id);
     $js[] = forward_static_call_array(array($xhr_cards, 'details'), array($modeler::model()->id));
     return implode(' ', $js);
 }
Пример #3
0
 public static function modelOperationsMenuItems($filter = '', $_model = null)
 {
     $module = static::$module;
     $modeler = $module::model()->modeler;
     $_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
     $items = array();
     if (\Sequode\Application\Modules\Account\Authority::canView($_model)) {
         $items[] = CardKit::onTapEventsXHRCallMenuItem('Details', 'cards/sequode/details', array($_model->id));
     }
     if (\Sequode\Application\Modules\Account\Authority::isInSequodeFavorites($_model)) {
         $items[] = CardKit::onTapEventsXHRCallMenuItem('Remove From Favorited', 'operations/account/removeFromSequodeFavorites', array($_model->id));
     } else {
         $items[] = CardKit::onTapEventsXHRCallMenuItem('Add To Favorited', 'operations/account/addToSequodeFavorites', array($_model->id));
     }
     if (\Sequode\Application\Modules\Sequode\Authority::isSequence($_model)) {
         $items[] = CardKit::onTapEventsXHRCallMenuItem('View Chart', 'cards/sequode/chart', array($_model->id));
         if (\Sequode\Application\Modules\Account\Authority::canEdit($_model)) {
             $items[] = CardKit::onTapEventsXHRCallMenuItem('Edit Chart', 'cards/sequode/sequencer', array($_model->id));
         }
         if (\Sequode\Application\Modules\Account\Authority::canEdit($_model)) {
             if (!\Sequode\Application\Modules\Sequode\Authority::isEmptySequence($_model)) {
                 $items[] = CardKit::onTapEventsXHRCallMenuItem('Empty Sequence', 'operations/sequode/emptySequence', array($_model->id));
             }
         }
         if (\Sequode\Application\Modules\Account\Authority::canEdit($_model)) {
             if (!\Sequode\Application\Modules\Sequode\Authority::isEmptySequence($_model)) {
                 $items[] = CardKit::onTapEventsXHRCallMenuItem('Restore To Default', 'operations/sequode/formatSequence', array($_model->id));
             }
         }
         if (\Sequode\Application\Modules\Account\Authority::canCopy($_model)) {
             if (!\Sequode\Application\Modules\Sequode\Authority::isEmptySequence($_model)) {
                 $items[] = CardKit::onTapEventsXHRCallMenuItem('Clone', 'operations/sequode/cloneSequence', array($_model->id));
             }
         }
         if (\Sequode\Application\Modules\Account\Authority::canEdit($_model)) {
             if (!\Sequode\Application\Modules\Sequode\Authority::isEmptySequence($_model)) {
                 $items[] = CardKit::onTapEventsXHRCallMenuItem('Internal Forms', 'cards/sequode/internalForms', array($_model->id));
             }
         }
         if (\Sequode\Application\Modules\Account\Authority::canDelete($_model)) {
             if (\Sequode\Application\Modules\Sequode\Authority::isEmptySequence($_model)) {
                 $items[] = CardKit::onTapEventsXHRCallMenuItem('Delete', 'operations/sequode/deleteSequence', array($_model->id));
             }
         }
     }
     return $items;
 }