瀏覽代碼

Adding confirmation when deleting an element - career - promotion

Julio Montoya 14 年之前
父節點
當前提交
3e2dfb5cac
共有 3 個文件被更改,包括 6 次插入4 次删除
  1. 3 1
      main/admin/career_dashboard.php
  2. 2 2
      main/admin/careers.php
  3. 1 1
      main/admin/promotions.php

+ 3 - 1
main/admin/career_dashboard.php

@@ -74,6 +74,7 @@ foreach($career_array as $career_id => $data) {
     $career     = $data['name'];
     $promotions = $data['promotions'];        
     $career = Display::url($career,'careers.php?action=edit&id='.$career_id);
+    $career = Display::tag('h3',$career);
     echo '<tr><td style="background-color:#eee" colspan="3">'.$career.'</td></tr>';   
     foreach($promotions as $promotion_id => $promotion) {         
     	$promotion_name = $promotion['name'];
@@ -87,7 +88,8 @@ foreach($career_array as $career_id => $data) {
         	$rowspan = 'rowspan="'.$count.'"';
         }
         echo '<td '.$rowspan.'>';        
-        echo $promotion_url;
+        //echo $promotion_url;
+          echo Display::tag('h4',$promotion_url);
         echo '</td>';
         echo '</tr>';      
          

+ 2 - 2
main/admin/careers.php

@@ -59,8 +59,8 @@ $extra_params['autowidth'] = 'true';
 $extra_params['height'] = 'auto'; 
 
 //With this function we can add actions to the jgrid
-$action_links = 'function action_formatter (cellvalue, options, rowObject) {
-                         return \'<a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a> <a href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
+$action_links = 'function action_formatter(cellvalue, options, rowObject) {
+                         return \'<a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a> <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
                  }';
 ?>
 <script>

+ 1 - 1
main/admin/promotions.php

@@ -56,7 +56,7 @@ $extra_params['autowidth'] = 'true'; //use the width of the parent
 $extra_params['height'] = 'auto'; //use the width of the parent
 //With this function we can add actions to the jgrid
 $action_links = 'function action_formatter (cellvalue, options, rowObject) {
-                    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'"><img title="'.get_lang('AddSession').'" src="../img/addd.gif"></a> <a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a>  <a href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
+                    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'"><img title="'.get_lang('AddSession').'" src="../img/addd.gif"></a> <a href="?action=edit&id=\'+options.rowId+\'"><img src="../img/edit.gif" title="'.get_lang('Edit').'"></a>  <a <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?action=delete&id=\'+options.rowId+\'"><img title="'.get_lang('Delete').'" src="../img/delete.gif"></a>\'; 
                  }';
 
 ?>